Skip to content

How to unit test socketio AsyncServer deployed with Sanic using unittest.TestCase? #848

Answered by miguelgrinberg
nsmkhn asked this question in Q&A
Discussion options

You must be logged in to vote

I have no experience unit testing with Sanic, so I cannot help you there. For the Socket.IO server you have two options, you can start a real server and then connect to it with a real client, or else you can just call your Socket.IO handlers directly and make sure they do what they need to do (mocking any emits or other things that need to be suppressed during tests).

Related: #465

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nsmkhn
Comment options

@miguelgrinberg
Comment options

@nsmkhn
Comment options

Answer selected by nsmkhn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants