""" Pytest configuration and fixtures. """ import pytest from httpx import AsyncClient, ASGITransport from src.main import app @pytest.fixture def anyio_backend(): """Use asyncio for async tests.""" return "asyncio" @pytest.fixture async def client(): """Async HTTP client for testing.""" async with AsyncClient( transport=ASGITransport(app=app), base_url="http://test" ) as ac: yield ac @pytest.fixture async def auth_client(): """Async HTTP client with API key for authenticated requests.""" async with AsyncClient( transport=ASGITransport(app=app), base_url="http://test", headers={"X-API-Key": "test-api-key"} ) as ac: yield ac