Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Remove old client test; ensure server starts on every test

Jeremiah Lowina1955eb5cdfe
diff --git a/tests/client/test_streamable_http.py b/tests/client/test_streamable_http.py
index f0ee398bd..11f4b4e33 100644
--- a/tests/client/test_streamable_http.py
+++ b/tests/client/test_streamable_http.py
@@ -1,7 +1,7 @@
import asyncio
import json
import sys
-from collections.abc import Generator
+from collections.abc import AsyncGenerator
import pytest
import uvicorn
@@ -87,9 +87,11 @@ def run_nested_server(host: str, port: int) -> None:
server.run()
[email protected](scope="module")
-def streamable_http_server() -> Generator[str, None, None]:
+async def streamable_http_server() -> AsyncGenerator[str, None]:
with run_server_in_process(run_server, transport="streamable-http") as url:
+ async with Client(transport=StreamableHttpTransport(f"{url}/mcp")) as client:
+ assert await client.ping()
yield f"{url}/mcp"
@@ -158,13 +160,3 @@ class TestTimeout:
) as client:
with pytest.raises(McpError):
await client.call_tool("sleep", {"seconds": 0.2}, timeout=0.1)
-
- async def test_timeout_client_timeout_overrides_tool_call_timeout_if_lower(
- self, streamable_http_server: str
- ):
- with pytest.raises(McpError):
- async with Client(
- transport=StreamableHttpTransport(streamable_http_server),
- timeout=0.1,
- ) as client:
- await client.call_tool("sleep", {"seconds": 0.2}, timeout=2)