-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathconftest.py
More file actions
25 lines (21 loc) · 1.28 KB
/
Copy pathconftest.py
File metadata and controls
25 lines (21 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Ensure the repo root is importable when running ``python -m pytest`` from anywhere."""
import os
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
# The update reminder reaches out to the network to look up the newest release. Keep the
# offline test suite network-inert by default; tests that exercise the feature opt back in
# explicitly via monkeypatch (see tests/test_update_check.py).
os.environ.setdefault("ENGRAPHIS_UPDATE_CHECK", "0")
# Owner machines may configure ENGRAPHIS_EXTRACTOR=llm_structured (via ~/.engraphis/config.env
# or an exported shell variable), which would make every ingest-path test block on live LLM
# extraction calls — and under tests/conftest.py's DNS stub they hang instead of failing
# fast. The unit suite is offline-inert by contract (AGENTS.md §1 "primary offline gate");
# tests that exercise extraction opt back in explicitly via monkeypatch.setenv, so this is
# forced rather than setdefault: no shell export can leak a live LLM into the gate.
os.environ["ENGRAPHIS_EXTRACTOR"] = "none"
# The legacy scripts/test_*.py files are HTTP smoke tests (need a running server +
# httpx), not unit tests. Keep pytest focused on the tests/ suite.
collect_ignore_glob = ["scripts/*"]