New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flask-SocketIO returns [] on get_received
function call
#2063
Comments
@shivansh-vishwakarma Please provide a complete and runnable example test that shows the problem and I'll investigate. |
Hope this helps.
In the given code the |
How is this any different than the many tests in this repository's test suite? I wanted to see a complete and runnable example, because this feels like it is a problem in your own setup, not in this package. Please provide a complete example that includes the application to be tested. |
@miguelgrinberg This should suffice the requirement. I've abstracted out the functionality of flask and socket to reproduce the same with minimal code. https://github.com/shivansh-vishwakarma/flask-socket-scratch |
One more thing that i noticed which abstracting the functionality was, |
Okay, thanks. This is actually a different bug in Flask-SocketIO, I will have a fix in the next couple of days. |
Also, Can you confirm if there is support to emit messages to a particular room using |
If the client is in the room, then any messages sent to that client should appear in the test client's |
@shivansh-vishwakarma in the example you provided, your test sends this event:
But your server does not have an event handler for socketio.on('your_event')
def your_event(data):
emit('got it') Am I missing anything? |
No, your are correct. My bad @miguelgrinberg |
Flask-SocketIO's
get_received(namespace=None)
function is not returning the messages received from server.I am using SocketIOTestClient for writing test cases for the flask application.
Went through the code seems like the
get_received
uses self.queue to get the events to emitted and couldn't find where the queue is being populated. Can someone help here?The text was updated successfully, but these errors were encountered: