1. Eric Larson
  2. pytest.el

Pull requests

#1 Merged
Repository
tdavis
Branch
default
Repository
elarson
Branch
default

Use relative paths to test files to fix fixture discovery.

Author
  1. Tom Davis
Reviewers
Description

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.

  • Learn about pull requests

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.