Files
AI/ontology_platform/tests/conftest.py
LASTA_DEV01\lasta 9e88f4c7ad ontology
2026-05-13 19:57:34 +09:00

24 lines
651 B
Python

"""Pytest configuration for all tests.
Ensures proper sys.path setup so that:
1. `platform.*` modules are imported from ./platform (not stdlib)
2. `ontocast.*` modules are imported from ./vendored/ontocast
"""
from __future__ import annotations
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent
VENDORED_ONTOCAST = REPO_ROOT / "vendored" / "ontocast"
for p in (REPO_ROOT, VENDORED_ONTOCAST):
p_str = str(p)
if p_str not in sys.path:
sys.path.insert(0, p_str)
# Remove stdlib 'platform' to avoid conflict with our platform package
if "platform" in sys.modules:
del sys.modules["platform"]