Open felixonmars opened 4 years ago
for a fixture shared by multiple modules, recommend to put your fixture in conftest.py in your parent module.
I think this is not a bug. the fixture is found first in "./dir1/dir2", so it is bound to namespace "./dir1/dir2", and you folder has no __init__.py, so the fixture cannot be found in "./dir2"
add __init__.py to dir1 and dir2, then it is OK.
.
├── dir1
│ ├── __init__.py
│ └── dir2 -> ../dir2
├── dir2
│ ├── __init__.py
│ └── test_fixture.py
I see. I encountered this when running the test suite for another project, so I excluded the actually duplicated tests to workaround. Just thought this is something that pytest itself might want to address...
I have created a minimal case:
The error is present in latest 5.2.4 version as well.