@@ -832,7 +832,7 @@ async def initialized_client_session(basic_server: None, basic_server_url: str):
832
832
833
833
834
834
@pytest .mark .anyio
835
- async def test_streamable_http_client_basic_connection (basic_server , basic_server_url ):
835
+ async def test_streamable_http_client_basic_connection (basic_server : None , basic_server_url : str ):
836
836
"""Test basic client connection with initialization."""
837
837
async with streamable_http_client (f"{ basic_server_url } /mcp" ) as (
838
838
read_stream ,
@@ -850,7 +850,7 @@ async def test_streamable_http_client_basic_connection(basic_server, basic_serve
850
850
851
851
852
852
@pytest .mark .anyio
853
- async def test_streamable_http_client_resource_read (initialized_client_session ):
853
+ async def test_streamable_http_client_resource_read (initialized_client_session : ClientSession ):
854
854
"""Test client resource read functionality."""
855
855
response = await initialized_client_session .read_resource (uri = AnyUrl ("foobar://test-resource" ))
856
856
assert len (response .contents ) == 1
@@ -860,7 +860,7 @@ async def test_streamable_http_client_resource_read(initialized_client_session):
860
860
861
861
862
862
@pytest .mark .anyio
863
- async def test_streamable_http_client_tool_invocation (initialized_client_session ):
863
+ async def test_streamable_http_client_tool_invocation (initialized_client_session : ClientSession ):
864
864
"""Test client tool invocation."""
865
865
# First list tools
866
866
tools = await initialized_client_session .list_tools ()
@@ -875,7 +875,7 @@ async def test_streamable_http_client_tool_invocation(initialized_client_session
875
875
876
876
877
877
@pytest .mark .anyio
878
- async def test_streamable_http_client_error_handling (initialized_client_session ):
878
+ async def test_streamable_http_client_error_handling (initialized_client_session : ClientSession ):
879
879
"""Test error handling in client."""
880
880
with pytest .raises (McpError ) as exc_info :
881
881
await initialized_client_session .read_resource (uri = AnyUrl ("unknown://test-error" ))
@@ -884,7 +884,7 @@ async def test_streamable_http_client_error_handling(initialized_client_session)
884
884
885
885
886
886
@pytest .mark .anyio
887
- async def test_streamable_http_client_session_persistence (basic_server , basic_server_url ):
887
+ async def test_streamable_http_client_session_persistence (basic_server : None , basic_server_url : str ):
888
888
"""Test that session ID persists across requests."""
889
889
async with streamable_http_client (f"{ basic_server_url } /mcp" ) as (
890
890
read_stream ,
@@ -912,7 +912,7 @@ async def test_streamable_http_client_session_persistence(basic_server, basic_se
912
912
913
913
914
914
@pytest .mark .anyio
915
- async def test_streamable_http_client_json_response (json_response_server , json_server_url ):
915
+ async def test_streamable_http_client_json_response (json_response_server : None , json_server_url : str ):
916
916
"""Test client with JSON response mode."""
917
917
async with streamable_http_client (f"{ json_server_url } /mcp" ) as (
918
918
read_stream ,
@@ -940,7 +940,7 @@ async def test_streamable_http_client_json_response(json_response_server, json_s
940
940
941
941
942
942
@pytest .mark .anyio
943
- async def test_streamable_http_client_get_stream (basic_server , basic_server_url ):
943
+ async def test_streamable_http_client_get_stream (basic_server : None , basic_server_url : str ):
944
944
"""Test GET stream functionality for server-initiated messages."""
945
945
import mcp .types as types
946
946
from mcp .shared .session import RequestResponder
@@ -981,7 +981,7 @@ async def message_handler(
981
981
982
982
983
983
@pytest .mark .anyio
984
- async def test_streamable_http_client_session_termination (basic_server , basic_server_url ):
984
+ async def test_streamable_http_client_session_termination (basic_server : None , basic_server_url : str ):
985
985
"""Test client session termination functionality."""
986
986
987
987
captured_session_id = None
@@ -1023,7 +1023,9 @@ async def test_streamable_http_client_session_termination(basic_server, basic_se
1023
1023
1024
1024
1025
1025
@pytest .mark .anyio
1026
- async def test_streamable_http_client_session_termination_204 (basic_server , basic_server_url , monkeypatch ):
1026
+ async def test_streamable_http_client_session_termination_204 (
1027
+ basic_server : None , basic_server_url : str , monkeypatch : pytest .MonkeyPatch
1028
+ ):
1027
1029
"""Test client session termination functionality with a 204 response.
1028
1030
1029
1031
This test patches the httpx client to return a 204 response for DELETEs.
@@ -1088,7 +1090,7 @@ async def mock_delete(self: httpx.AsyncClient, *args: Any, **kwargs: Any) -> htt
1088
1090
1089
1091
1090
1092
@pytest .mark .anyio
1091
- async def test_streamable_http_client_resumption (event_server ):
1093
+ async def test_streamable_http_client_resumption (event_server : tuple [ SimpleEventStore , str ] ):
1092
1094
"""Test client session resumption using sync primitives for reliable coordination."""
1093
1095
_ , server_url = event_server
1094
1096
0 commit comments