Repository navigation
any-language test: survive a stray site-packages tests package (unblocks make release on macOS) - #131
Merged
Merged
Conversation
On the owner's Mac (Python 3.11.4) make release failed: a regular top-level `tests` package elsewhere on sys.path beats the fixture's namespace tests/ dir, so `from tests.shim import sub` could not import and gate-red-verify (correctly) blocked a collection error. The fixtures' tests/ are now regular packages, and the test always runs with such a stray package on PYTHONPATH (red before the fixture change, green after). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FeZyj76Lmsc72D4cioNdac
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
make releasefor 0.14.0 failed on the owner's Mac (Python 3.11.4) inany-language.test.py:118withModuleNotFoundError: No module named 'tests.shim'.Cause. The fixture's
tests/has no__init__.py, so it is a namespace package. A regular top-leveltestspackage elsewhere onsys.pathwins over a namespace package, even one that comes earlier on the path; some site-packages ship one. Thenfrom tests.shim import subfails, and gate-red-verify correctly reports a collection error. The gate is fine; the bug is in the test fixture.Fix. The fixtures'
tests/become regular packages. The test now always puts a straytestspackage onPYTHONPATH, so this can't come back.Evidence. With the stray package and without the fixture change, the test fails with the same
ModuleNotFoundErrorseen on the Mac. With the fixture change it passes 12/12, and it also passes 12/12 without the stray package.Generated by Claude Code