Skip to content

fix(tests): root pytest run collects all 3 packages via importlib (TAP-4575)#195

Merged
wtthornton merged 1 commit into
masterfrom
tap-4575-root-test-collision
Jul 2, 2026
Merged

fix(tests): root pytest run collects all 3 packages via importlib (TAP-4575)#195
wtthornton merged 1 commit into
masterfrom
tap-4575-root-test-collision

Conversation

@wtthornton

Copy link
Copy Markdown
Owner

What

Fixes the cross-package pytest import collision (TAP-4575) that broke the root pytest run — three identically-named tests trees (docs-mcp / tapps-core / tapps-mcp) caused ImportPathMismatchError, forcing per-package invocations and leaving the root full-suite gate broken.

Fix (root-cause, no suppression)

  • --import-mode=importlib + consider_namespace_packages=true in pyproject.toml addopts
  • drop the three colliding tests/__init__.py files so the tests trees are namespace packages
  • pythonpath=["packages/docs-mcp"] so docs-mcp's from tests.helpers import ... still resolves (only docs-mcp ships tests/helpers.py)
  • collapse the prepush-smoke.sh / run-regression.sh per-package loops into a single root run (restores cross-package xdist parallelism)

Proof

uv run pytest --co -q at repo root → 10244 tests collected in 2.99s, 0 errors (previously errored on the collision). No test deleted/skipped/xfailed; no package excluded from collection.

🤖 Generated with Claude Code

…P-4575)

Cross-package ImportPathMismatchError from three identically-named `tests`
trees broke the root `pytest` run, forcing per-package invocations. Switch to
--import-mode=importlib + consider_namespace_packages, drop the colliding
tests/__init__.py files, and pin docs-mcp on pythonpath so `from tests.helpers`
still resolves. Collapse the prepush/regression per-package loops into a single
root run. Root collection now: 10244 tests collected, 0 errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wtthornton wtthornton merged commit dad70e2 into master Jul 2, 2026
2 checks passed
@wtthornton wtthornton deleted the tap-4575-root-test-collision branch July 2, 2026 18:06
wtthornton added a commit that referenced this pull request Jul 2, 2026
…71) (#196)

Module tapps_mcp.project.test_linker_cache (added by #195) was missing
from tapps_mcp.spec hiddenimports, re-reddening master on
test_all_modules_have_hidden_imports. Restores a green full suite.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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