Skip to content

Commit 6b172cc

Browse files
committed
fix(build): fixes for pre-commit run --all-files
Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 581c817 commit 6b172cc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/mcp/client/streamable_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ async def handle_get_stream(self, client: httpx.AsyncClient, read_stream_writer:
200200

201201
# Stream ended normally (server closed) - reset attempt counter
202202
attempt = 0
203-
203+
204204
except httpx.HTTPStatusError as exc: # pragma: lax no cover
205205
# Handle HTTP errors that are retryable
206206
if exc.response.status_code == 405:

tests/issues/test_streamable_http_405_get_stream.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ async def mock_github_endpoint(request: Request) -> Response:
6262
)
6363
return Response(status_code=405)
6464

65+
6566
@pytest.mark.anyio
6667
async def test_405_get_stream_does_not_hang(caplog: pytest.LogCaptureFixture):
6768
"""Test that client handles 405 on GET gracefully and doesn't hang."""
@@ -91,9 +92,9 @@ async def test_405_get_stream_does_not_hang(caplog: pytest.LogCaptureFixture):
9192

9293
# Verify the 405 was logged and no retries occurred
9394
log_messages = [record.getMessage() for record in caplog.records]
94-
assert any(
95-
"Server does not support GET for SSE events (405 Method Not Allowed)" in msg for msg in log_messages
96-
), f"Expected 405 log message not found in: {log_messages}"
95+
assert any("Server does not support GET for SSE events (405 Method Not Allowed)" in msg for msg in log_messages), (
96+
f"Expected 405 log message not found in: {log_messages}"
97+
)
9798

9899
reconnect_messages = [msg for msg in log_messages if "reconnecting" in msg.lower()]
99-
assert len(reconnect_messages) == 0, f"Should not retry on 405, but found: {reconnect_messages}"
100+
assert len(reconnect_messages) == 0, f"Should not retry on 405, but found: {reconnect_messages}"

0 commit comments

Comments
 (0)