[py-dev] Problems with test discovery (ImportError)

Hans Meine meine at informatik.uni-hamburg.de
Thu May 20 12:43:13 CEST 2010


Hi,

I had successfully toyed with py.test in the past, and just wanted to use it 
again, instead of nosetests.  However, py.test fails with

E           ImportError: No module named something.test_foo

This seems to be caused by a package subdirectory called 'io'.  Here's how to 
reproduce this (not necessarily minimal yet):

mkdir -p test_ImportError/io/something
touch test_ImportError/io/something/test_foo.py
touch test_ImportError/io/something/__init__.py
touch test_ImportError/io/__init__.py
py.test test_ImportError/io/something

Obviously, this is a bug that should be fixed, but I would already happy if 
you could tell me a workaround (i.e. different invocation of py.test, without 
changing the directory name of course).

Have a nice day,
  Hans

PS: Please CC me as I did not subscribe for this single report.  Thanks.



More information about the Pytest-dev mailing list