Add paths to sys.path
Add paths to
A pytest plugin to help pytest find the code you want to test.
Install with pip:
pip install pytest-srcpaths
Add a line in your pytest.ini file with a key of
It should contain a space-separated list of paths.
[pytest] srcpaths = src lib
Paths are relative to the directory that pytest.ini is in.
You can include the top level directory with a dot.
[pytest] srcpaths = .
pythonpath also works the same.
[pytest] pythonpath = src lib
pytest 7 (not released yet) is planned to include the
For pytest 6.2.x, this plugin will work.
- 1.2.1 - Add
pythonpathas an alternative to
srcpathoption for pytest versions < 7.0.0
- this is to allow this project to act as a temporary workaround until pytest 7 is released
This plugin was inspired by pytest-pythonpath whose implementation and scope are a bit different.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
pytest-srcpaths-1.2.1.tar.gz (5.7 kB view hashes)
Hashes for pytest_srcpaths-1.2.1-py3-none-any.whl