py.test - Testerkennung schlägt fehl, wenn Tests in verschiedenen Verzeichnissen als gleich bezeichnet werden

Bei Verwendung von py.test schlagen zwei Tests, die in verschiedenen Verzeichnissen als gleich bezeichnet werden, fehl. Warum das? Wie kann ich dies ändern, ohne alle Tests umzubenennen?

Um zu duplizieren, mache:

; cd /var/tmp/my_test_module
; mkdir -p ook/test           
; mkdir -p eek/test
; touch ook/test/test_proxy.py
; touch eek/test/test_proxy.py
; py.test
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-2.2.4
collected 0 items / 1 errors 

==================================== ERRORS ====================================
___________________ ERROR collecting ook/test/test_proxy.py ____________________
import file mismatch:
imported module 'test_proxy' has this __file__ attribute:
  /home/ygolanski/code/junk/python/mymodule/eek/test/test_proxy.py
which is not the same as the test file we want to collect:
  /home/ygolanski/code/junk/python/mymodule/ook/test/test_proxy.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
=========================== 1 error in 0.01 seconds ============================

Antworten auf die Frage(4)

Ihre Antwort auf die Frage