Skip to content

Commit 1083f75

Browse files
author
dragogargo
committed
fix: restore pragma no cover on unreachable cancel_scope guard
Line 147-148 is unreachable: _cancel_scope is always set in __init__. The previous pragma removal was too aggressive - only remove pragmas from lines that are actually covered by the new tests.
1 parent 7a9b105 commit 1083f75

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mcp/shared/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async def cancel(self) -> None:
144144
"""Cancel this request and mark it as completed."""
145145
if not self._entered:
146146
raise RuntimeError("RequestResponder must be used as a context manager")
147-
if not self._cancel_scope:
147+
if not self._cancel_scope: # pragma: no cover
148148
raise RuntimeError("No active cancel scope")
149149

150150
self._cancel_scope.cancel()

0 commit comments

Comments
 (0)