Files
AI/ontology_platform/tests/integration/conftest.py

34 lines
879 B
Python
Raw Normal View History

2026-05-13 19:57:34 +09:00
"""Shared fixtures for integration tests.
Sets up the Python path so `import platform.api.main` resolves the local
package (not the stdlib `platform` module) and exposes helpers that turn
the FastAPI app into a controllable test harness.
"""
from __future__ import annotations
import sys
from pathlib import Path
import pytest
REPO_ROOT = Path(__file__).resolve().parents[2]
if str(REPO_ROOT) not in sys.path:
sys.path.insert(0, str(REPO_ROOT))
VENDORED_ONTOCAST = REPO_ROOT / "vendored" / "ontocast"
if str(VENDORED_ONTOCAST) not in sys.path:
sys.path.insert(0, str(VENDORED_ONTOCAST))
@pytest.fixture
def fixtures_dir() -> Path:
return REPO_ROOT / "tests" / "fixtures"
@pytest.fixture
def sample_json_path(fixtures_dir: Path) -> Path:
path = fixtures_dir / "sample_cryogenics.json"
assert path.exists(), f"Missing fixture: {path}"
return path