Skip to content

Commit 88a791b

Browse files
committed
Add no branch pragmas to phase-1 ClientSession blocks
The block-exit arcs from these three async with lines were never actually traced on 3.11 or 3.14 — on main, the arc destinations were lax-no-cover lines, so coverage silently excluded the arcs from counting. Removing those destinations in the previous commit exposed the latent gap. Adding no branch here is a smaller suppression than what we removed: the assertions that used to be lax-no-cover are now fully verified, and we only suppress branch-exit tracking on async with lines that have no actual branching. Matches the existing no branch on the phase-2 ClientSession lines in these same tests.
1 parent 23b3fbe commit 88a791b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/shared/test_streamable_http.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ async def test_streamable_http_client_session_termination(basic_server: None, ba
11321132
read_stream,
11331133
write_stream,
11341134
):
1135-
async with ClientSession(read_stream, write_stream) as session:
1135+
async with ClientSession(read_stream, write_stream) as session: # pragma: no branch
11361136
# Initialize the session
11371137
result = await session.initialize()
11381138
assert isinstance(result, InitializeResult)
@@ -1193,7 +1193,7 @@ async def mock_delete(self: httpx.AsyncClient, *args: Any, **kwargs: Any) -> htt
11931193
read_stream,
11941194
write_stream,
11951195
):
1196-
async with ClientSession(read_stream, write_stream) as session:
1196+
async with ClientSession(read_stream, write_stream) as session: # pragma: no branch
11971197
# Initialize the session
11981198
result = await session.initialize()
11991199
assert isinstance(result, InitializeResult)
@@ -1251,7 +1251,9 @@ async def on_resumption_token_update(token: str) -> None:
12511251
read_stream,
12521252
write_stream,
12531253
):
1254-
async with ClientSession(read_stream, write_stream, message_handler=message_handler) as session:
1254+
async with ClientSession( # pragma: no branch
1255+
read_stream, write_stream, message_handler=message_handler
1256+
) as session:
12551257
# Initialize the session
12561258
result = await session.initialize()
12571259
assert isinstance(result, InitializeResult)

0 commit comments

Comments
 (0)