Problem
TestSuiteGate.verify runs:
subprocess.run(..., cwd=str(file_path.parent))
- Command
python3 -m pytest (hard-coded interpreter)
So pytest often runs without the repo's pyproject.toml / pytest.ini / conftest.py context when the edited file is nested, and it may not use the same interpreter/venv as the host process.
Impact
False positives (tests fail for config reasons) or tests not discovered at all; CI vs local mismatch.
Suggested direction
- Use
sys.executable instead of python3.
- Set
cwd to the resolved project root (same as issue for threading project_root).
- Consider forwarding
PYTHONPATH or documented env for edge cases.
References
refactron/verification/checks/test_gate.py (subprocess.run, cwd)
Problem
TestSuiteGate.verifyruns:subprocess.run(..., cwd=str(file_path.parent))python3 -m pytest(hard-coded interpreter)So pytest often runs without the repo's
pyproject.toml/pytest.ini/conftest.pycontext when the edited file is nested, and it may not use the same interpreter/venv as the host process.Impact
False positives (tests fail for config reasons) or tests not discovered at all; CI vs local mismatch.
Suggested direction
sys.executableinstead ofpython3.cwdto the resolved project root (same as issue for threadingproject_root).PYTHONPATHor documented env for edge cases.References
refactron/verification/checks/test_gate.py(subprocess.run,cwd)