Skip to content

Commit 511b4d8

Browse files
committed
fix test suite
1 parent 8642aba commit 511b4d8

File tree

4 files changed

+218
-249
lines changed

4 files changed

+218
-249
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"anyio>=4.5",
2626
"httpx>=0.27",
2727
"httpx-sse>=0.4",
28-
"pydantic>=2.7.2,<3.0.0",
28+
"pydantic>=2.8.0,<3.0.0",
2929
"starlette>=0.27",
3030
"python-multipart>=0.0.9",
3131
"sse-starlette>=1.6.1",
@@ -58,6 +58,7 @@ dev = [
5858
"pytest-examples>=0.0.14",
5959
"pytest-pretty>=1.2.0",
6060
"inline-snapshot>=0.23.0",
61+
"dirty-equals>=0.9.0",
6162
]
6263
docs = [
6364
"mkdocs>=1.6.1",

tests/issues/test_188_concurrency.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
from pydantic import AnyUrl
44

55
from mcp.server.fastmcp import FastMCP
6-
from mcp.shared.memory import (
7-
create_connected_server_and_client_session as create_session,
8-
)
6+
from mcp.shared.memory import create_connected_server_and_client_session as create_session
97

108
_sleep_time_seconds = 0.01
119
_resource_name = "slow://slow_resource"
1210

1311

12+
@pytest.mark.filterwarnings(
13+
"ignore:coroutine 'test_messages_are_executed_concurrently.<locals>.slow_resource' was never awaited:RuntimeWarning"
14+
)
1415
@pytest.mark.anyio
1516
async def test_messages_are_executed_concurrently():
1617
server = FastMCP("test")
@@ -46,15 +47,3 @@ async def slow_resource():
4647
active_calls -= 1
4748
print(f"Max concurrent calls: {max_concurrent_calls}")
4849
assert max_concurrent_calls > 1, "No concurrent calls were executed"
49-
50-
51-
def main():
52-
anyio.run(test_messages_are_executed_concurrently)
53-
54-
55-
if __name__ == "__main__":
56-
import logging
57-
58-
logging.basicConfig(level=logging.DEBUG)
59-
60-
main()

tests/server/fastmcp/test_func_metadata.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import annotated_types
55
import pytest
6+
from dirty_equals import IsPartialDict
67
from pydantic import BaseModel, Field
78

89
from mcp.server.fastmcp.utilities.func_metadata import func_metadata
@@ -202,11 +203,8 @@ def func_dict_any() -> dict[str, Any]:
202203
return {"a": 1, "b": "hello", "c": [1, 2, 3]}
203204

204205
meta = func_metadata(func_dict_any)
205-
assert meta.output_schema == {
206-
"additionalProperties": True,
207-
"type": "object",
208-
"title": "func_dict_anyDictOutput",
209-
}
206+
207+
assert meta.output_schema == IsPartialDict(type="object", title="func_dict_anyDictOutput")
210208

211209
# Test dict[str, str]
212210
def func_dict_str() -> dict[str, str]:

0 commit comments

Comments
 (0)