I thought py.test is \"standalone\" in a sense that it treats test_*.py files \"as it is\", and only imports modules specified in these files, with
Looks like py.test is using py._path.pyimport to open your file. If there is a __init__.py file in the directory, it treats your file as a module, otherwise it opens the file. Long story short, delete the __init__.py or put your tests in another directory outside your project code (<--- good idea).
http://doc.pylib.org/en/latest/_modules/py/_path/local.html#LocalPath.pyimport