Skip to content

Improve venv resolution for cross-platform test compatibility#51

Merged
srichs merged 1 commit intomainfrom
codex/fix-test-failures-in-coverage-checks
Feb 17, 2026
Merged

Improve venv resolution for cross-platform test compatibility#51
srichs merged 1 commit intomainfrom
codex/fix-test-failures-in-coverage-checks

Conversation

@srichs
Copy link
Owner

@srichs srichs commented Feb 17, 2026

Motivation

  • Tests on Windows-like environments were failing because virtualenvs can expose the interpreter at either Scripts/python.exe or bin/python, and the code assumed a single layout.
  • Subprocess argument differences across platforms caused inconsistent invocation formatting in tests.

Description

  • Update venv_python to compute both Scripts/python.exe and bin/python, preferring the OS-native location but falling back to the alternate when present.
  • Keep find_venv selection logic unchanged while making interpreter existence checks resilient to both layouts.
  • Normalize the interpreter path passed to subprocess.call in run_py by using as_posix() for consistent argument formatting across platforms.

Testing

  • Ran pytest -q tests/test_venv.py tests/test_cli.py::test_doctor_reports_detected_venv tests/test_cli.py::test_doctor_reports_missing_venv_with_hint and the targeted tests passed.
  • Ran the full suite with pytest -q and all tests passed (91 passed).

Codex Task

@srichs srichs merged commit 62d02b9 into main Feb 17, 2026
8 checks passed
@srichs srichs deleted the codex/fix-test-failures-in-coverage-checks branch February 17, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant