Reputation: 11
I'm struggling with tox tool. I have tox installed in my activated virtual environment, lets call the virtual environment parentenv
. I basically use tox to test my project against different versions of Python. Based on my understanding of tox, it's supposed create isolated virtual environments, install all dependencies and run test in those isolated virtual environments. The error I'm facing is that tox is able to created these virtual environments but fails to activate these isolated virtual environments and rather uses the virtual environment of the project (i.e.: parentenv
) and run the tests in that environment.
Below is the content of my tox.ini
located in the project's root directory. All commands are run from the root directory.
tox.ini
[tox]
envlist = py39, py310
skipsdist = true
[testenv]
allowlist_externals = poetry
commands =
poetry install -v
poetry run pytest here
My Workflow is (commands are run from the project's root directory):
$ poetry shell
$ tox
Below is a sample output from running tox
:
Upvotes: 1
Views: 693
Reputation: 6121
Having a look at your "sample output", the second marked line is not from tox, but from poetry.
You should have a look at the official documentation of poetry for tox: https://python-poetry.org/docs/faq/#is-tox-supported
The differences at first sight:
isolated_build
directive in your tox.iniUpvotes: 1