fix(parsing): add root conftest.py so pytest resolves codex package

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-06-04 23:34:34 +02:00
parent c6a428d335
commit 291a66dd38

17
conftest.py Normal file
View File

@@ -0,0 +1,17 @@
"""Root conftest — ensures the project root is on sys.path.
Required when the virtual-environment Python is symlinked to an external
interpreter (e.g. Anaconda) that does not process the venv's .pth files
automatically. Adding the project root here makes ``codex`` importable
regardless of how pytest is invoked (``pytest``, ``python -m pytest``, etc.).
"""
from __future__ import annotations
import sys
from pathlib import Path
# Insert the project root so `import codex` always resolves.
_project_root = str(Path(__file__).parent)
if _project_root not in sys.path:
sys.path.insert(0, _project_root)