mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
commit
349e556b15
3 changed files with 7 additions and 15 deletions
|
|
@ -7,7 +7,7 @@ dependencies = [
|
|||
"python-dotenv>=1.1.0",
|
||||
"exceptiongroup>=1.2.2",
|
||||
"httpx>=0.28.1",
|
||||
"mcp>=1.9.2,<2.0.0",
|
||||
"mcp>=1.9.4,<2.0.0",
|
||||
"openapi-pydantic>=0.5.1",
|
||||
"rich>=13.9.4",
|
||||
"typer>=0.15.2",
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def streamable_http_server() -> Generator[str, None, None]:
|
||||
@pytest.fixture()
|
||||
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)
|
||||
|
|
|
|||
2
uv.lock
generated
2
uv.lock
generated
|
|
@ -472,7 +472,7 @@ requires-dist = [
|
|||
{ name = "authlib", specifier = ">=1.5.2" },
|
||||
{ name = "exceptiongroup", specifier = ">=1.2.2" },
|
||||
{ name = "httpx", specifier = ">=0.28.1" },
|
||||
{ name = "mcp", specifier = ">=1.9.2,<2.0.0" },
|
||||
{ name = "mcp", specifier = ">=1.9.4,<2.0.0" },
|
||||
{ name = "openapi-pydantic", specifier = ">=0.5.1" },
|
||||
{ name = "python-dotenv", specifier = ">=1.1.0" },
|
||||
{ name = "rich", specifier = ">=13.9.4" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue