This problem will happen if you have a tests.py
file and a tests folder with tests/__init__.py
.
During the collection pytest finds the folder, but when it tries to import the test files from the folder, tests.py
file will cause the import problem.
To fix simply remove the tests.py
file and put all your tests inside the tests/
folder.
For your specific case the fix will be precisely:
/home/zz/Desktop/GitFolders/rc/tests.py
/home/zz/Desktop/GitFolders/rc/tests/__init__.py
is present