Problem
packages/router's test script decides whether to run Python tests by checking CI:
if [ "$CI" = "true" ]; then echo 'Skipping Python tests in CI (pytest not available)'; exit 0; else python3 -m pytest tests/test_router.py -v; fi
The comment says the intent is "pytest not available", but the implemented condition is "we are in CI". Those are different things, and they come apart on a developer machine: a contributor with no pytest, or a broken pytest install, gets a hard failure from a plain npm test at the repo root.
Reproduced on macOS with Python 3.14:
$ npm test --workspace=packages/router
ImportError: cannot import name 'FixtureDef' from 'pytest'
npm error Lifecycle script `test` failed with error: code 1
CI=true npm test passes, which is why CI has never caught it. The workaround is undocumented, so the first thing a new contributor sees is a red test run in a repo whose tests are actually fine.
Suggested fix
Gate on the real condition rather than the proxy — probe for a usable pytest and skip with a clear message when it is missing, in CI or not. Something like:
python3 -m pytest --version >/dev/null 2>&1 && python3 -m pytest tests/test_router.py -v || echo 'Skipping Python tests: no usable pytest on PATH'
That keeps the tests running wherever pytest works, including CI if pytest is ever installed there, and stops punishing machines where it is not.
Context
Found while fixing the intra-workspace peer dependency ranges. Deliberately kept out of that PR to keep its diff to one concern.
Same failure shape as the peer-dep bug: a proxy condition standing in for the condition actually meant.
Problem
packages/router's test script decides whether to run Python tests by checkingCI:The comment says the intent is "pytest not available", but the implemented condition is "we are in CI". Those are different things, and they come apart on a developer machine: a contributor with no pytest, or a broken pytest install, gets a hard failure from a plain
npm testat the repo root.Reproduced on macOS with Python 3.14:
CI=true npm testpasses, which is why CI has never caught it. The workaround is undocumented, so the first thing a new contributor sees is a red test run in a repo whose tests are actually fine.Suggested fix
Gate on the real condition rather than the proxy — probe for a usable pytest and skip with a clear message when it is missing, in CI or not. Something like:
That keeps the tests running wherever pytest works, including CI if pytest is ever installed there, and stops punishing machines where it is not.
Context
Found while fixing the intra-workspace peer dependency ranges. Deliberately kept out of that PR to keep its diff to one concern.
Same failure shape as the peer-dep bug: a proxy condition standing in for the condition actually meant.