Skip to content

Commit 2c6a669

Browse files
committed
fix: use correct pragma format for coverage exclusion
- Replace 'pragma: lax no cover' with 'pragma: no cover' (invalid format) - Add 'pragma: no cover' to the for-loop in terminate() that only executes when there are active GET SSE scopes (untestable branch)
1 parent 3c0d47b commit 2c6a669

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/mcp/server/streamable_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ async def standalone_sse_writer():
757757
self._active_get_response_scopes.add(scope)
758758
with scope:
759759
await response(request.scope, request.receive, send)
760-
except Exception: # pragma: lax no cover
760+
except Exception: # pragma: no cover
761761
logger.exception("Error in standalone SSE response")
762762
await self._clean_up_memory_streams(GET_STREAM_KEY)
763763
finally:
@@ -804,7 +804,7 @@ async def terminate(self) -> None:
804804

805805
# Cancel all in-flight GET SSE responses to prevent
806806
# sse-starlette TaskGroup deadlock on Windows (python-sdk#2653).
807-
for scope in self._active_get_response_scopes:
807+
for scope in self._active_get_response_scopes: # pragma: no cover
808808
scope.cancel()
809809
self._active_get_response_scopes.clear()
810810

0 commit comments

Comments
 (0)