Skip to content

Commit 12b04c2

Browse files
fix: correct RequestContext type annotation and add pragma for uncovered except
1 parent 2255218 commit 12b04c2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/shared/test_streamable_http.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
from mcp import MCPError, types
3131
from mcp.client.session import ClientSession
32+
from mcp.client.streamable_http import RequestContext as HTTPRequestContext
3233
from mcp.client.streamable_http import StreamableHTTPTransport, streamable_http_client
3334
from mcp.server import Server, ServerRequestContext
3435
from mcp.server.streamable_http import (
@@ -2345,7 +2346,7 @@ async def test_reconnection_attempt_counter_increments_on_clean_disconnect(
23452346

23462347
async def spy_handle_reconnection(
23472348
self: StreamableHTTPTransport,
2348-
ctx: object,
2349+
ctx: HTTPRequestContext,
23492350
last_event_id: str,
23502351
retry_interval_ms: int | None = None,
23512352
attempt: int = 0,
@@ -2369,7 +2370,7 @@ async def spy_handle_reconnection(
23692370
"tool_with_multiple_stream_closes",
23702371
{"checkpoints": 3, "sleep_time": 0.6},
23712372
)
2372-
except Exception:
2373+
except Exception: # pragma: no cover
23732374
pass
23742375

23752376
# With the fix: attempts seen are [0, 1, 2] — counter increments on each clean close.

0 commit comments

Comments
 (0)