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

@ -177,7 +177,6 @@ class TestGitHubTokenVerifier:
) # Parent TokenVerifier sets empty list as default
assert verifier.timeout_seconds == 10
@pytest.mark.asyncio
async def test_verify_token_github_api_failure(self):
"""Test token verification when GitHub API returns error."""
verifier = GitHubTokenVerifier()
@ -196,7 +195,6 @@ class TestGitHubTokenVerifier:
result = await verifier.verify_token("invalid_token")
assert result is None
@pytest.mark.asyncio
async def test_verify_token_success(self):
"""Test successful token verification."""
from unittest.mock import AsyncMock