NokiaTube | New address | Mode Phone | On high quality
Skip to content

any-language test: survive a stray site-packages tests package (unblocks make release on macOS) - #131

Merged
adeelahmad merged 1 commit into
masterfrom
claude/project-thread-7590ji
Nov 22, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
claude/project-thread-7590ji

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

make release for 0.14.0 failed on the owner's Mac (Python 3.11.4) in any-language.test.py:118 with ModuleNotFoundError: No module named 'tests.shim'.

Cause. The fixture's tests/ has no __init__.py, so it is a namespace package. A regular top-level tests package elsewhere on sys.path wins over a namespace package, even one that comes earlier on the path; some site-packages ship one. Then from tests.shim import sub fails, 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 stray tests package on PYTHONPATH, so this can't come back.

Evidence. With the stray package and without the fixture change, the test fails with the same ModuleNotFoundError seen 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

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
@adeelahmad
adeelahmad merged commit 42a00ca into master Nov 22, 2026
5 checks passed
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.

2 participants