from __future__ import annotations import sys from pathlib import Path from fastapi.testclient import TestClient def get_gateway_test_client() -> TestClient: repo_root = Path(__file__).resolve().parents[2] gateway_root = repo_root / "services" / "governance-gateway" memory_root = repo_root / "services" / "memory-api" if str(gateway_root) not in sys.path: sys.path.insert(0, str(gateway_root)) if str(memory_root) not in sys.path: sys.path.insert(0, str(memory_root)) from eval.runners.common_memory_client import get_memory_test_client get_memory_test_client() from app.main import app # type: ignore return TestClient(app)