Skip to content

Commit 67b3b2c

Browse files
committed
backport: coverage — lax-no-cover post-unwind asserts on 3.11+lowest-direct
The 3.11 zero-cost-exception tracer dead-zone (python/cpython#106749) drops line events for sync statements between a cancel-on-exit __aexit__ and the next real await. On anyio 4.5.0 (lowest-direct) the unwind path differs from anyio 4.10 just enough that three additional post-async-with assertions fall in the dead-zone on 3.11 only. Same family as the markers added in 361bb9d.
1 parent 52a79c4 commit 67b3b2c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/interaction/transports/test_flows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ def echo(text: str) -> str:
121121
shttp_result = await shttp_client.call_tool("echo", {"text": "via http"})
122122
sse_result = await sse_client.call_tool("echo", {"text": "via sse"})
123123

124-
assert shttp_result == snapshot(
124+
assert shttp_result == snapshot( # pragma: lax no cover
125125
CallToolResult(content=[TextContent(type="text", text="via http")], structuredContent={"result": "via http"})
126126
)
127-
assert sse_result == snapshot(
127+
assert sse_result == snapshot( # pragma: lax no cover
128128
CallToolResult(content=[TextContent(type="text", text="via sse")], structuredContent={"result": "via sse"})
129129
)

tests/interaction/transports/test_sse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def httpx_client_factory(
6060
assert UUID(hex=captured_session_id[0]) in sse._read_stream_writers
6161
assert await client.send_ping() == snapshot(EmptyResult())
6262

63-
assert UUID(hex=captured_session_id[0]) in sse._read_stream_writers
63+
assert UUID(hex=captured_session_id[0]) in sse._read_stream_writers # pragma: lax no cover
6464

6565

6666
@requirement("transport:sse:post:session-routing")

0 commit comments

Comments
 (0)