ImportPathMismatchError
from subprojects with same test folder structure
#11206
Labels
topic: collection
related to the collection phase
We have a big CI job that runs pytest against a couple (sub)projects checked out side by side. We added a
__init__.py
file in one of thetests
folders to allow for some internal code reuse, and now the whole test suite fails to run with aImportPathMismatchError
.Minimal reproduction example:
So file structure is as follows
Running pytest in each of the subprojects works fine (
collected 0 items
, but that is expected).However, when running at the toplevel:
Apparently pytest doesn't like that both
projectA/tests/conftest.py
andprojectB/tests/conftest.py
map totests.conftest
.Is there a workaround for this?
(using pytest 7.4.0)
The text was updated successfully, but these errors were encountered: