mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 13:04:18 +02:00
Replace subprocess tests with in-process async servers (#2006)
* Use anyio as testing backend * Remove asyncio markers * Update streamable http tests * Replace all subprocess tests * Replace anyio task groups with asyncio context managers in tests - Convert run_server_async from anyio task group pattern to asyncio.create_task with async context manager - Remove task_group fixture from conftest - Update all test fixtures to use async with run_server_async pattern - Remove TaskGroup imports from all test files - Tests now work with pytest-asyncio instead of pytest-anyio * Update test_github_provider_integration.py
This commit is contained in:
parent
39aebcf578
commit
3321644ad3
28 changed files with 411 additions and 358 deletions
|
|
@ -124,7 +124,6 @@ class TestParameterHandling:
|
|||
},
|
||||
}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_query_parameters_in_tools(self, parameter_spec):
|
||||
"""Test that query parameters are properly included in tool parameters."""
|
||||
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
|
||||
|
|
@ -173,7 +172,6 @@ class TestParameterHandling:
|
|||
assert "query" in required
|
||||
assert "X-API-Key" in required
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_path_parameters_in_tools(self, parameter_spec):
|
||||
"""Test that path parameters are properly included in tool parameters."""
|
||||
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
|
||||
|
|
@ -279,7 +277,6 @@ class TestRequestBodyHandling:
|
|||
},
|
||||
}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_request_body_properties_in_tool(self, request_body_spec):
|
||||
"""Test that request body properties are included in tool parameters."""
|
||||
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
|
||||
|
|
@ -381,7 +378,6 @@ class TestResponseSchemas:
|
|||
},
|
||||
}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_tool_has_output_schema(self, response_schema_spec):
|
||||
"""Test that tools have output schemas from response definitions."""
|
||||
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue