Separate function handler modules when using Python Socketio

In this article I will show you how you can have separate modules for your Socketio event handlers. Rather than keeping them all in the same file. Hopefully this should be a relatively short article, lets get into it Main In this example I will be using SocketIO alongside FastAPI, but you can easily change this code to be SocketIO only. I also will be using a uvicorn to run the server. ...

Testing a socketio Web App written in Python

In this article I will show you how you can test an async Socketio application in Python, where the ASGI server we are running is uvicorn. I will be referring to these tests as integration tests, though depending on who you ask they could be called E2E tests, system tests, slow test etc. What I am referring to is simply testing out the entire “flow” of a socketio event i.e. emitting an event from a client, then receiving it on the web service and for my actual projects interacting with an actual database. ...