Tox

Command line

Some useful options:

  • tox -l - list environments

  • tox -e envname[,envname...] - run tests for just those environments

Configuration

Links:

Substitutions

E.g. {toxinidir}} expands to the directory where tox.ini is, and {{env:ENV_NAME}} expands to the value of ENV_NAME from the environment:

Environment variables

Set env vars for the test:

[testenv]
setenv =
    VAR1 = value1
    VAR2 = value2

Warning

By default tox strips most values from the environment.

You can override with passenv. I generally just put:

passenv = *

in every tox.ini file.