@@ -89,20 +89,14 @@ async def mock_server():
8989
9090 # Wait half the timeout, then send progress
9191 await anyio .sleep (0.15 )
92- await server_write .send (
93- _make_progress_notification (progress_token = request_id , progress = 0.5 , total = 1.0 )
94- )
92+ await server_write .send (_make_progress_notification (progress_token = request_id , progress = 0.5 , total = 1.0 ))
9593
9694 # Wait past the original timeout (0.3s total) so the request
9795 # would have timed out without the reset
9896 await anyio .sleep (0.25 )
9997
10098 # Now respond
101- await server_write .send (
102- SessionMessage (
103- message = JSONRPCResponse (jsonrpc = "2.0" , id = request_id , result = {})
104- )
105- )
99+ await server_write .send (SessionMessage (message = JSONRPCResponse (jsonrpc = "2.0" , id = request_id , result = {})))
106100
107101 result_holder : list [types .EmptyResult ] = []
108102
@@ -193,13 +187,9 @@ async def mock_server():
193187
194188 # Send progress at 80ms and 160ms (within the 0.3s window)
195189 await anyio .sleep (0.08 )
196- await server_write .send (
197- _make_progress_notification (progress_token = request_id , progress = 0.3 , total = 1.0 )
198- )
190+ await server_write .send (_make_progress_notification (progress_token = request_id , progress = 0.3 , total = 1.0 ))
199191 await anyio .sleep (0.08 )
200- await server_write .send (
201- _make_progress_notification (progress_token = request_id , progress = 0.6 , total = 1.0 )
202- )
192+ await server_write .send (_make_progress_notification (progress_token = request_id , progress = 0.6 , total = 1.0 ))
203193 # Stop sending progress — let the client timeout after the
204194 # last reset window expires
205195
@@ -249,11 +239,7 @@ async def mock_server():
249239
250240 # Respond after the 3rd progress
251241 await anyio .sleep (0.05 )
252- await server_write .send (
253- SessionMessage (
254- message = JSONRPCResponse (jsonrpc = "2.0" , id = request_id , result = {})
255- )
256- )
242+ await server_write .send (SessionMessage (message = JSONRPCResponse (jsonrpc = "2.0" , id = request_id , result = {})))
257243
258244 result_holder : list [types .EmptyResult ] = []
259245
@@ -297,9 +283,7 @@ async def mock_server():
297283
298284 # Send progress at 80ms (before the 0.3s timeout)
299285 await anyio .sleep (0.08 )
300- await server_write .send (
301- _make_progress_notification (progress_token = request_id , progress = 0.5 , total = 1.0 )
302- )
286+ await server_write .send (_make_progress_notification (progress_token = request_id , progress = 0.5 , total = 1.0 ))
303287
304288 # Wait past the original timeout
305289 await anyio .sleep (0.5 )
@@ -336,9 +320,7 @@ async def test_call_tool_threads_reset_timeout():
336320 """Verify that ClientSession.call_tool passes reset_timeout_on_progress
337321 through to send_request, keeping a slow tool alive via progress."""
338322
339- async def handle_call_tool (
340- ctx : ServerRequestContext , params : types .CallToolRequestParams
341- ) -> types .CallToolResult :
323+ async def handle_call_tool (ctx : ServerRequestContext , params : types .CallToolRequestParams ) -> types .CallToolResult :
342324 assert ctx .request_id is not None
343325 # Send progress to keep the request alive
344326 for i in range (3 ):
0 commit comments