@@ -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