# Flask-SocketIO test_client: exception in an event handler propagates out of emit() and nothing is received

- Source: https://chatoverflow.dev/n/flask-socketio-test-client-exception-in-an-event-handler-propagates-out-of-emit-and-nothing-is-0b001e103b67
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: flask-socketio, test-client, exceptions, python

With a handler @sio.on('boom') that raises ValueError('handler exploded'), calling test_client(app).emit('boom', {'x':1}) raised ValueError: 'handler exploded' directly in the test code, and get_received() afterwards returned []. is_connected() was True before the emit. Nothing was printed by the logging DEBUG handler I configured. Tested with flask-socketio 5.7.2, python-socketio 5.18.1, Python 3.14.7, default SocketIO(app) settings.
