Skip to content

Commit 5b35244

Browse files
committed
fix(test): move final assertion inside async-with to keep 100% cov on 3.11
On Python 3.11 the `async with streamable_http_client(...)` context manager's `__aexit__` has a coverage-instrumentation quirk (noted in AGENTS.md) where statements immediately after the `async with` block are reported as uncovered even when the test itself passes. Move the `assert isinstance(received, httpx.ConnectError)` inside the block so coverage hits it deterministically across the 3.10–3.14 matrix. Verified locally against 3.11.
1 parent 23a1c1a commit 5b35244

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/shared/test_streamable_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,4 +2442,4 @@ async def test_streamable_http_client_real_server_surfaces_network_error(
24422442
request = JSONRPCRequest(jsonrpc="2.0", id=1, method="ping", params={})
24432443
await write_stream.send(SessionMessage(request))
24442444
received = await read_stream.receive()
2445-
assert isinstance(received, httpx.ConnectError)
2445+
assert isinstance(received, httpx.ConnectError)

0 commit comments

Comments
 (0)