Runs pytest in isolation.
Tests | |
Activity | |
QA | |
Other |
tox-isolation
runs pytest tests in isolation by copying the test directory into a temporary directory and running the tests from there. This prevents pytest from trying to use the source files for the project, instead forcing it to use the version installed in the virtualenv by tox.
The files copied into the temporary directory are controlled bu the isolate_dirs
option in the testenv
section of tox.ini
. This allows the files to be customised on a per-env basis. If the option is undefined the isolation is disabled. Relative paths are taken to be relative to the current working directory.
Example:
# tox.ini
[testenv]
deps = -r{toxinidir}/tests/requirements.txt
commands = python -m pytest tests/ {posargs}
isolate_dirs = {toxinidir}/tests
tox-isolation
can be installed from GitHub.
To install with pip
:
$ python -m pip install git+https://github.com/domdfcoding/tox-isolation