conftest.py 435 B

1234567891011121314151617
  1. """Keep unit tests isolated from a developer's local model credentials."""
  2. import sys
  3. from pathlib import Path
  4. import pytest
  5. ROOT = Path(__file__).parents[1]
  6. SRC = ROOT / "src"
  7. if str(SRC) not in sys.path:
  8. sys.path.insert(0, str(SRC))
  9. @pytest.fixture(autouse=True)
  10. def isolate_local_llm_credentials(monkeypatch):
  11. monkeypatch.delenv("LONGCAT_API_KEY", raising=False)
  12. monkeypatch.setenv("ONTOREFACTOR_LLM_MODE", "auto")