Skip to content

fix: TestSuiteGate should use project root cwd and current Python for pytest #188

@omsherikar

Description

@omsherikar

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtesting

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions