Skip to content

Commit 7a2e591

Browse files
committed
test: adjust no-cover markers for coverage gates
1 parent fe98f89 commit 7a2e591

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/client/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,11 +1197,11 @@ async def test_auth_flow_no_unnecessary_retry_after_oauth(
11971197
await auth_flow.asend(response) # extra request
11981198
request_yields += 1 # pragma: no cover
11991199
# If we reach here, the bug is present
1200-
pytest.fail(
1200+
pytest.fail( # pragma: no cover
12011201
f"Unnecessary retry detected! Request was yielded {request_yields} times. "
12021202
f"This indicates the retry logic bug that caused 2x performance degradation. "
12031203
f"The request should only be yielded once for successful responses."
1204-
) # pragma: no cover
1204+
)
12051205
except StopAsyncIteration:
12061206
# This is the expected behavior - no unnecessary retry
12071207
pass

tests/client/test_notification_response.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ async def test_non_compliant_notification_response() -> None:
8181
"""
8282
returned_exception = None
8383

84-
async def message_handler( # pragma: no cover
84+
async def message_handler(
8585
message: RequestResponder[types.ServerRequest, types.ClientResult] | types.ServerNotification | Exception,
8686
) -> None:
8787
nonlocal returned_exception
88-
if isinstance(message, Exception):
89-
returned_exception = message
88+
if isinstance(message, Exception): # pragma: no cover
89+
returned_exception = message # pragma: no cover
9090

9191
async with httpx.AsyncClient(transport=httpx.ASGITransport(app=_create_non_sdk_server_app())) as client:
9292
async with streamable_http_client("http://localhost/mcp", http_client=client) as (read_stream, write_stream):
@@ -97,7 +97,7 @@ async def message_handler( # pragma: no cover
9797
await session.send_notification(RootsListChangedNotification(method="notifications/roots/list_changed"))
9898

9999
if returned_exception: # pragma: no cover
100-
pytest.fail(f"Server encountered an exception: {returned_exception}")
100+
pytest.fail(f"Server encountered an exception: {returned_exception}") # pragma: no cover
101101

102102

103103
async def test_unexpected_content_type_sends_jsonrpc_error() -> None:

0 commit comments

Comments
 (0)