from __future__ import annotations import sys from pathlib import Path import pytest from fastapi.testclient import TestClient BACKEND_ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(BACKEND_ROOT)) from app.main import create_app # noqa: E402 from app.services import RuleBasedExperienceExtractor, RuleBasedResumeRewriter # noqa: E402 @pytest.fixture def client(tmp_path: Path) -> TestClient: application = create_app( database_path=tmp_path / "test.db", cors_origins=["http://localhost:5173"], extractor=RuleBasedExperienceExtractor(), rewriter=RuleBasedResumeRewriter(), ) with TestClient(application) as test_client: yield test_client