@@ -310,8 +310,7 @@ async def run_server():
310310 async with anyio .create_task_group () as tg :
311311
312312 async def handle_messages ():
313- # TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
314- async for message in server_session .incoming_messages : # pragma: no cover
313+ async for message in server_session .incoming_messages :
315314 await server ._handle_message (message , server_session , {}, False )
316315
317316 tg .start_soon (handle_messages )
@@ -388,8 +387,8 @@ async def run_server():
388387 ),
389388 ) as server_session :
390389 async with anyio .create_task_group () as tg :
391- # TODO(Marcelo): Drop the pragma once https://github.com/coveragepy/coveragepy/issues/1987 is fixed.
392- async def handle_messages (): # pragma: no cover
390+
391+ async def handle_messages ():
393392 async for message in server_session .incoming_messages :
394393 await server ._handle_message (message , server_session , {}, False )
395394
@@ -573,7 +572,7 @@ async def test_build_elicit_form_request() -> None:
573572 assert (
574573 request_with_task .params ["_meta" ]["io.modelcontextprotocol/related-task" ]["taskId" ] == "test-task-123"
575574 )
576- finally : # pragma: no cover
575+ finally :
577576 await server_to_client_send .aclose ()
578577 await server_to_client_receive .aclose ()
579578 await client_to_server_send .aclose ()
@@ -619,7 +618,7 @@ async def test_build_elicit_url_request() -> None:
619618 assert (
620619 request_with_task .params ["_meta" ]["io.modelcontextprotocol/related-task" ]["taskId" ] == "test-task-789"
621620 )
622- finally : # pragma: no cover
621+ finally :
623622 await server_to_client_send .aclose ()
624623 await server_to_client_receive .aclose ()
625624 await client_to_server_send .aclose ()
@@ -670,7 +669,7 @@ async def test_build_create_message_request() -> None:
670669 request_with_task .params ["_meta" ]["io.modelcontextprotocol/related-task" ]["taskId" ]
671670 == "sampling-task-456"
672671 )
673- finally : # pragma: no cover
672+ finally :
674673 await server_to_client_send .aclose ()
675674 await server_to_client_receive .aclose ()
676675 await client_to_server_send .aclose ()
@@ -707,7 +706,7 @@ async def test_send_message() -> None:
707706 received = await server_to_client_receive .receive ()
708707 assert isinstance (received .message , JSONRPCNotification )
709708 assert received .message .method == "test/notification"
710- finally : # pragma: no cover
709+ finally :
711710 await server_to_client_send .aclose ()
712711 await server_to_client_receive .aclose ()
713712 await client_to_server_send .aclose ()
@@ -761,7 +760,7 @@ def route_error(self, request_id: str | int, error: ErrorData) -> bool:
761760 assert len (routed_responses ) == 1
762761 assert routed_responses [0 ]["id" ] == "test-req-1"
763762 assert routed_responses [0 ]["response" ]["status" ] == "ok"
764- finally : # pragma: no cover
763+ finally :
765764 await server_to_client_send .aclose ()
766765 await server_to_client_receive .aclose ()
767766 await client_to_server_send .aclose ()
@@ -816,7 +815,7 @@ def route_error(self, request_id: str | int, error: ErrorData) -> bool:
816815 assert len (routed_errors ) == 1
817816 assert routed_errors [0 ]["id" ] == "test-req-2"
818817 assert routed_errors [0 ]["error" ].message == "Test error"
819- finally : # pragma: no cover
818+ finally :
820819 await server_to_client_send .aclose ()
821820 await server_to_client_receive .aclose ()
822821 await client_to_server_send .aclose ()
@@ -874,7 +873,7 @@ def route_error(self, request_id: str | int, error: ErrorData) -> bool:
874873
875874 # Verify both routers were called (first returned False, second returned True)
876875 assert router_calls == ["non_matching_response" , "matching_response" ]
877- finally : # pragma: no cover
876+ finally :
878877 await server_to_client_send .aclose ()
879878 await server_to_client_receive .aclose ()
880879 await client_to_server_send .aclose ()
@@ -933,7 +932,7 @@ def route_error(self, request_id: str | int, error: ErrorData) -> bool:
933932
934933 # Verify both routers were called (first returned False, second returned True)
935934 assert router_calls == ["non_matching_error" , "matching_error" ]
936- finally : # pragma: no cover
935+ finally :
937936 await server_to_client_send .aclose ()
938937 await server_to_client_receive .aclose ()
939938 await client_to_server_send .aclose ()
0 commit comments