File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -318,8 +318,21 @@ async def mock_receive():
318318 assert error_data ["error" ]["message" ] == "Session not found"
319319
320320
321+ @pytest .fixture
322+ def reset_sse_app_status ():
323+ # Needed for tests with sse-starlette < 3
324+ # https://github.com/sysid/sse-starlette/issues/59
325+ # https://github.com/sysid/sse-starlette/blob/v3.2.0/README.md#testing
326+
327+ from sse_starlette .sse import AppStatus
328+
329+ AppStatus .should_exit_event = None # pyright: ignore[reportAttributeAccessIssue]
330+ yield
331+ AppStatus .should_exit_event = None # pyright: ignore[reportAttributeAccessIssue]
332+
333+
321334@pytest .mark .anyio
322- async def test_e2e_streamable_http_server_cleanup ():
335+ async def test_e2e_streamable_http_server_cleanup (reset_sse_app_status : None ):
323336 host = "testserver"
324337 app = Server ("test-server" )
325338
You can’t perform that action at this time.
0 commit comments