Using py.test, two tests called the same in different directory causes py.test to fail. Why is that? How can I change this without renaming all the tests?
To duplica
I had the same error, but the solution had nothing to do with the init files nor the name on the test files. I had different python versions on my macbook and on my Docker container. I launched the tests once in the bash from the macbook at the root of the project, instead of the bash of the container.
The solution was to remove the wrongly created files by running (from the bash of the container):
find -name '*.pyc' -delete
find -name __pycache__ -delete
Then launch the test again (still from the bash of the container) and everything worked just fine:
py.test