Skip to content

fix(pytest-matrix): put .venv/bin on PATH so which()-gated tests do not silently skip#12

Merged
ywatanabe1989 merged 1 commit into
mainfrom
fix/venv-bin-on-path-in-pytest-matrix
Jul 22, 2026
Merged

fix(pytest-matrix): put .venv/bin on PATH so which()-gated tests do not silently skip#12
ywatanabe1989 merged 1 commit into
mainfrom
fix/venv-bin-on-path-in-pytest-matrix

Conversation

@ywatanabe1989

Copy link
Copy Markdown
Contributor

Console scripts installed into the venv are not resolvable from inside the test process, so any test gating on shutil.which("<tool>") skips. A skip is not a failure, so the suite still reports green while the gate never ran.

Evidence

In scitex-ai/scitex-hub#433, tests/develop/test_audit.py::test_audit_all_clean — the repo's brand quality gate — differs across the two environments on the same code:

workflow result
develop's retired actions/setup-python job PASSED (and emitted its 150-masked-violations warning, i.e. it did the work)
this reusable SKIPPED (scitex-de...)

scitex-dev is installed into .venv by -e ".[all,dev]", but shutil.which("scitex-dev") returns None because .venv/bin is not on PATH. The skip sat inside a green 2289 passed.

Fix

export PATH="$PWD/.venv/bin:$PATH" before pytest — the same line quality-audit.yml already runs. This is a parity fix, not a behavior change: it re-arms a gate that the unification silently disarmed.

…ot silently skip

Console scripts installed into the venv are not resolvable from inside
the test process, so any test gating on `shutil.which("<tool>")` SKIPS.
A skip is not a failure, so the suite still reports green while the gate
never ran — the check that could not run reports what a check that passed
reports.

Observed in scitex-ai/scitex-hub#433: tests/develop/test_audit.py (the
brand quality gate) was PASSED on the retired setup-python workflow and
became SKIPPED under this reusable, because scitex-dev was installed into
.venv but absent from PATH. It sat inside a green '2289 passed'.

quality-audit.yml already exports this same PATH; this brings pytest-matrix
to parity.
@ywatanabe1989
ywatanabe1989 merged commit 976cdfc into main Jul 22, 2026
1 check passed
@ywatanabe1989
ywatanabe1989 deleted the fix/venv-bin-on-path-in-pytest-matrix branch July 22, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant