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
: