py.test starts running tests in the virtualenv
faassen opened this issue · comments
When I use py.test as in the README it starts running tests in lib/python2.7/site-packages
. The readme should at least explain you should qualify the py.test command.
This is actually a bug. Are you sure you're running the py.test defined by the virtualenv (bin/py.test
)?
It is meant to work without any arguments and ignore the lib directory (see setup.cfg
for the list of excluded folders).
Weird. I am using bin/py.test
. It is using the version of pytest stored under lib/site-packages
too. I'm on Python 2, and I installed cookiecutter from another virtualenv.
It happens both when I invoke through bin/py.test
or when I activitate the virtualenv and do py.test
. The version of py.test that gets installed is 2.9.1.
Can you try to rename setup.cfg into a pytest.ini file in the generated package? Seems like py.test sometimes does not pick up setup.cfg:
http://stackoverflow.com/questions/11117062/how-to-tell-py-test-to-skip-certain-directories
Tried that, still the same behavior. I really don't get why this isn't working either...
By the way, I think I prefer pytest.ini for this instead of setup.cfg, but perhaps you have a good reason to use setup.cfg instead.
I just went ahead and reinstalled it all, still the same behavior. What am I doing differently?
Aaah, wait! I'm on 64 bit Linux, and I have a lib64 in my virtualenv!
Yeah, that fixes it. You need to add lib64 to setup.cfg (or pytest.ini).
Cool, thanks!