In the FAQ, there is a recommendation for how to use tox with Poetry. It suggests this tox.ini:
[tox]
isolated_build = true
envlist = py27, py36
[testenv]
whitelist_externals = poetry
commands =
poetry install -v
poetry run pytest tests/
With this configuration, when a user runs tox:
- tox packages the project with Poetry.
- tox creates a virtual environment.
- tox installs the package it built, but not its dependencies (
inst-nodeps).
- tox calls
poetry install, which installs the project dependencies, and then installs the project, as editable, overwriting what tox installed in step 3.
- tox calls
poetry run pytest tests which tests against the package as it exists in the working directory, not as it was packaged by Poetry.
To fix this, the recommended commands should be:
commands =
poetry install --no-root -v
poetry run pytest tests/