"""API test fixtures.""" from typing import AsyncGenerator import pytest from httpx import ASGITransport, AsyncClient from app.main import app_factory @pytest.fixture async def client() -> AsyncGenerator[AsyncClient, None]: """Create async HTTP client for API testing.""" app = app_factory() transport = ASGITransport(app=app) async with AsyncClient(transport=transport, base_url="http://test") as ac: yield ac @pytest.fixture def auth_headers() -> dict[str, str]: """Return mock authentication headers.""" return {"Authorization": "Bearer test_token", "X-User-Id": "user-123"}