When we cd to the project directory then supply the full root path to
tests (in the case of pytest-module, etc.) pytest gets confused and cannot
find custom fixtures.
Thanks for sending the patch! Would you mind telling me more about how you're using the custom fixtures? I want to test this locally and my fixture setup happens in conftest.py which is working for me.
I am also using conftest.py, however it is in a sub-folder. My layout is something like root -> nsp -> app -> tests -> func -> conftest.py, test_app.py; so the fixtures are meant for functional tests of the app. The root is where pytest.el will cd to, as it contains setup.py. The nsp level is a namespace package which contains the package app. If I am in test_app.py and do pytest-module, py.test complains that a fixture was not found.
In the future, I've switched development from mercurial to git and am using github (https://github.com/ionrock/pytest-el). If you have any other changes feel free to send a pull request there.
(The only real change is on line 87; sorry about the whitespace noise.)
Thanks for sending the patch! Would you mind telling me more about how you're using the custom fixtures? I want to test this locally and my fixture setup happens in conftest.py which is working for me.
I am also using conftest.py, however it is in a sub-folder. My layout is something like
root -> nsp -> app -> tests -> func -> conftest.py, test_app.py
; so the fixtures are meant for functional tests of the app. Theroot
is where pytest.el will cd to, as it contains setup.py. Thensp
level is a namespace package which contains the packageapp
. If I am intest_app.py
and dopytest-module
, py.test complains that a fixture was not found.Looks good. Thanks!!
In the future, I've switched development from mercurial to git and am using github (https://github.com/ionrock/pytest-el). If you have any other changes feel free to send a pull request there.