@@ -1172,7 +1172,7 @@ async def test_streamable_http_client_session_termination(basic_server: None, ba
11721172 write_stream ,
11731173 _ ,
11741174 ):
1175- async with ClientSession (read_stream , write_stream ) as session :
1175+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
11761176 # Attempt to make a request after termination
11771177 with pytest .raises ( # pragma: no branch
11781178 McpError ,
@@ -1239,7 +1239,7 @@ async def mock_delete(self: httpx.AsyncClient, *args: Any, **kwargs: Any) -> htt
12391239 write_stream ,
12401240 _ ,
12411241 ):
1242- async with ClientSession (read_stream , write_stream ) as session :
1242+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
12431243 # Attempt to make a request after termination
12441244 with pytest .raises ( # pragma: no branch
12451245 McpError ,
@@ -1368,8 +1368,8 @@ async def run_tool():
13681368 # We should have received the remaining notifications
13691369 assert len (captured_notifications ) == 1
13701370
1371- assert isinstance (captured_notifications [0 ].root , types .LoggingMessageNotification )
1372- assert captured_notifications [0 ].root .params .data == "Second notification after lock"
1371+ assert isinstance (captured_notifications [0 ].root , types .LoggingMessageNotification ) # pragma: no cover
1372+ assert captured_notifications [0 ].root .params .data == "Second notification after lock" # pragma: no cover
13731373
13741374
13751375@pytest .mark .anyio
@@ -1552,7 +1552,7 @@ async def test_streamablehttp_request_context_propagation(context_aware_server:
15521552 write_stream ,
15531553 _ ,
15541554 ):
1555- async with ClientSession (read_stream , write_stream ) as session :
1555+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
15561556 result = await session .initialize ()
15571557 assert isinstance (result , InitializeResult )
15581558 assert result .serverInfo .name == "ContextAwareServer"
@@ -1590,7 +1590,7 @@ async def test_streamablehttp_request_context_isolation(context_aware_server: No
15901590 write_stream ,
15911591 _ ,
15921592 ):
1593- async with ClientSession (read_stream , write_stream ) as session :
1593+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
15941594 await session .initialize ()
15951595
15961596 # Call the tool that echoes context
@@ -2305,7 +2305,7 @@ async def test_streamable_http_client_mcp_headers_override_defaults(
23052305 write_stream ,
23062306 _ ,
23072307 ):
2308- async with ClientSession (read_stream , write_stream ) as session :
2308+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
23092309 await session .initialize ()
23102310
23112311 # Use echo_headers tool to see what headers the server actually received
@@ -2340,7 +2340,7 @@ async def test_streamable_http_client_preserves_custom_with_mcp_headers(
23402340 write_stream ,
23412341 _ ,
23422342 ):
2343- async with ClientSession (read_stream , write_stream ) as session :
2343+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
23442344 await session .initialize ()
23452345
23462346 # Use echo_headers tool to verify both custom and MCP headers are present
@@ -2390,7 +2390,7 @@ async def test_streamablehttp_client_deprecation_warning(basic_server: None, bas
23902390 write_stream ,
23912391 _ ,
23922392 ):
2393- async with ClientSession (read_stream , write_stream ) as session :
2393+ async with ClientSession (read_stream , write_stream ) as session : # pragma: no branch
23942394 await session .initialize ()
23952395 tools = await session .list_tools ()
23962396 assert len (tools .tools ) > 0
0 commit comments