Skip to content

Commit 491fc72

Browse files
rudi193-cmdclaude
andcommitted
style: apply ruff format to session.py and test_1401
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b406a37 commit 491fc72

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/mcp/shared/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ async def _handle_response(self, message: SessionMessage) -> None:
516516
if stream:
517517
await stream.send(message.message)
518518
else:
519-
logging.warning("Received response with unknown request ID %r — dropping (request may have timed out)", response_id)
519+
logging.warning(
520+
"Received response with unknown request ID %r — dropping (request may have timed out)", response_id
521+
)
520522

521523
async def _received_request(self, responder: RequestResponder[ReceiveRequestT, SendResultT]) -> None:
522524
"""Can be overridden by subclasses to handle a request without needing to

tests/issues/test_1401_client_session_error_handling.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ async def test_default_message_handler_raises_on_exception():
3737
@pytest.mark.anyio
3838
async def test_default_message_handler_checkpoints_on_notification():
3939
"""_default_message_handler should checkpoint (not raise) for non-exception messages."""
40-
notification = types.ToolListChangedNotification(
41-
method="notifications/tools/list_changed"
42-
)
40+
notification = types.ToolListChangedNotification(method="notifications/tools/list_changed")
4341
# Should complete without raising
4442
await _default_message_handler(notification)
4543

@@ -64,9 +62,7 @@ async def handle_list_tools(
6462
tools=[types.Tool(name="slow", description="hangs", input_schema={"type": "object"})]
6563
)
6664

67-
async def handle_call_tool(
68-
ctx: ServerRequestContext, params: CallToolRequestParams
69-
) -> CallToolResult:
65+
async def handle_call_tool(ctx: ServerRequestContext, params: CallToolRequestParams) -> CallToolResult:
7066
slow_tool_started.set()
7167
await anyio.sleep(60) # hangs until cancelled
7268
return CallToolResult(content=[TextContent(type="text", text="never")]) # pragma: no cover

0 commit comments

Comments
 (0)