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:
Jeremiah Lowin 2025-10-19 10:47:54 -04:00 committed by GitHub
commit 3321644ad3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 411 additions and 358 deletions

View file

@ -118,7 +118,6 @@ class TestParameterCollisions:
},
}
@pytest.mark.asyncio
async def test_path_body_collision_handling(self, collision_spec):
"""Test that path and body parameters with same name are handled correctly."""
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
@ -159,7 +158,6 @@ class TestParameterCollisions:
id_required = any("id" in req for req in required)
assert id_required
@pytest.mark.asyncio
async def test_query_header_collision_handling(self, collision_spec):
"""Test that query and header parameters with same name are handled correctly."""
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
@ -190,7 +188,6 @@ class TestParameterCollisions:
query_required = any("query" in req for req in required)
assert query_required
@pytest.mark.asyncio
async def test_collision_resolution_maintains_functionality(self, collision_spec):
"""Test that collision resolution doesn't break basic tool functionality."""
async with httpx.AsyncClient(base_url="https://api.example.com") as client: