Skip to content

Commit 7a9b105

Browse files
author
dragogargo
committed
fix: remove stale pragma no cover from lines now covered by tests
strict-no-cover correctly identified that cancel() guards and notification validation are now exercised by the new cancellation tests. Remove the outdated pragmas per AGENTS.md guidelines.
1 parent 486872c commit 7a9b105

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/mcp/shared/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ async def respond(self, response: SendResultT | ErrorData) -> None:
142142

143143
async def cancel(self) -> None:
144144
"""Cancel this request and mark it as completed."""
145-
if not self._entered: # pragma: no cover
145+
if not self._entered:
146146
raise RuntimeError("RequestResponder must be used as a context manager")
147-
if not self._cancel_scope: # pragma: no cover
147+
if not self._cancel_scope:
148148
raise RuntimeError("No active cancel scope")
149149

150150
self._cancel_scope.cancel()
@@ -423,7 +423,7 @@ async def _handle_session_message(message: SessionMessage) -> None:
423423
await self._handle_incoming(notification)
424424
except Exception:
425425
# For other validation errors, log and continue
426-
logging.warning( # pragma: no cover
426+
logging.warning(
427427
f"Failed to validate notification:. Message was: {message.message}",
428428
exc_info=True,
429429
)

0 commit comments

Comments
 (0)