Pull requests

#1 Merged
tdavis tdavis
elarson elarson

Use relative paths to test files to fix fixture discovery.

  1. Tom Davis avatarTom Davis

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.

Comments (4)

  1. Eric Larson repo owner

    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.

  2. Tom Davis author

    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.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.