Skip to content

Commit 6ed6261

Browse files
committed
test: remove ResourceWarning filter that was masking the stream leak bug
The filterwarnings on test_sse_client_handles_empty_keepalive_pings was added in PR #1753 with a comment claiming the leak was a test artifact from mocking aconnect_sse. It wasn't — it was the real sse_client bug where read_stream and write_stream_reader were never closed in the finally block. With that bug now fixed, the filter is no longer needed.
1 parent ce00a76 commit 6ed6261

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

tests/shared/test_sse.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,6 @@ def test_sse_server_transport_endpoint_validation(endpoint: str, expected_result
544544
assert sse._endpoint.startswith("/")
545545

546546

547-
# ResourceWarning filter: When mocking aconnect_sse, the sse_client's internal task
548-
# group doesn't receive proper cancellation signals, so the sse_reader task's finally
549-
# block (which closes read_stream_writer) doesn't execute. This is a test artifact -
550-
# the actual code path (`if not sse.data: continue`) IS exercised and works correctly.
551-
# Production code with real SSE connections cleans up properly.
552-
@pytest.mark.filterwarnings("ignore::ResourceWarning")
553547
@pytest.mark.anyio
554548
async def test_sse_client_handles_empty_keepalive_pings() -> None:
555549
"""Test that SSE client properly handles empty data lines (keep-alive pings).

0 commit comments

Comments
 (0)