Skip to content

Commit 3b405a1

Browse files
rudi193-cmdclaude
andcommitted
test: fix coverage — remove unused handle_list_tools, mark else-branch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 491fc72 commit 3b405a1

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

tests/issues/test_1401_client_session_error_handling.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,13 @@ async def test_transport_exception_unblocks_pending_request():
5555
"""
5656
slow_tool_started = anyio.Event()
5757

58-
async def handle_list_tools(
59-
ctx: ServerRequestContext, params: types.PaginatedRequestParams | None
60-
) -> types.ListToolsResult:
61-
return types.ListToolsResult(
62-
tools=[types.Tool(name="slow", description="hangs", input_schema={"type": "object"})]
63-
)
64-
6558
async def handle_call_tool(ctx: ServerRequestContext, params: CallToolRequestParams) -> CallToolResult:
6659
slow_tool_started.set()
6760
await anyio.sleep(60) # hangs until cancelled
6861
return CallToolResult(content=[TextContent(type="text", text="never")]) # pragma: no cover
6962

7063
server = Server(
7164
name="test",
72-
on_list_tools=handle_list_tools,
7365
on_call_tool=handle_call_tool,
7466
)
7567

@@ -118,7 +110,7 @@ async def test_custom_message_handler_receives_exception():
118110
received: list[Exception] = []
119111

120112
async def capturing_handler(message: object) -> None:
121-
if isinstance(message, Exception):
113+
if isinstance(message, Exception): # pragma: lax no cover
122114
received.append(message) # capture — do not re-raise
123115

124116
server_writer, server_reader = anyio.create_memory_object_stream[SessionMessage](4)

0 commit comments

Comments
 (0)