@@ -1356,7 +1356,7 @@ async def test_streamablehttp_client_non_blocking_timeout(event_server: tuple[Si
13561356 captured_notifications : list [types .ServerNotification ] = []
13571357 tool_started = anyio .Event ()
13581358 tool_cancelled = anyio .Event ()
1359-
1359+
13601360 request_state_manager = InMemoryRequestStateManager [types .ClientRequest , types .ClientResult ]()
13611361
13621362 async def message_handler (
@@ -1371,12 +1371,11 @@ async def message_handler(
13711371 tool_started .set ()
13721372 else :
13731373 await tool_cancelled .wait ()
1374-
1374+
13751375 if isinstance (message .root , types .CancelledNotification ):
13761376 nonlocal tool_cancelled
13771377 tool_cancelled .set ()
13781378
1379-
13801379 # First, start the client session and begin the long-running tool
13811380 async with streamablehttp_client (f"{ server_url } /mcp" , terminate_on_close = False ) as (
13821381 read_stream ,
@@ -1395,11 +1394,10 @@ async def message_handler(
13951394
13961395 # Start a long-running tool in a task
13971396 async with anyio .create_task_group () as tg :
1397+
13981398 async def run_tool ():
13991399 request_id = await session .request_call_tool (
1400- "long_running_with_checkpoints" , arguments = {},
1401- timeout = 0.01 ,
1402- cancel_if_not_resumable = True
1400+ "long_running_with_checkpoints" , arguments = {}, timeout = 0.01 , cancel_if_not_resumable = True
14031401 )
14041402 assert request_id is None
14051403
0 commit comments