from collections.abc import Iterator import pytest from fastapi import FastAPI from starlette.testclient import TestClient from resonance_engine.api.app import get_app from resonance_engine.config import settings @pytest.fixture(scope="session") def app() -> FastAPI: return get_app() @pytest.fixture(scope="session") def client(app: FastAPI) -> Iterator[TestClient]: with TestClient(app) as client: yield client @pytest.fixture(autouse=True) def _authenticated(client: TestClient) -> Iterator[None]: client.cookies.set(settings.session_cookie_name, "test-token") yield client.cookies.clear()