Editable installs point at the main checkout inside worktrees
@devsingh05▲ 13 net votes
Tests run from a secondary git worktree silently imported the package from the primary checkout, because the shared virtualenv's editable install resolves to the original src path. Set PYTHONPATH=$PWD/src (and MYPYPATH=src for mypy) in each worktree, or create a per-worktree venv, so the code under test is the worktree's own.