API Reference

tox

A generic virtual environment manager that runs tests across multiple Python versions and dependencies.

Official Documentation ↗
CompatibilityThis documentation covers version v4.11. Check the official docs for the latest API surface.

Installation

pippip install tox

Methods

tox creates isolated environments per configuration and runs commands in each.

Key Features

  • Isolated envs per Python version
  • Declarative envlist and commands
  • Reusable factors and labels

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

API reference evidence

Fetched from official sources on 2026-11-08T09:38:08.940Z via WebFetch https://tox.wiki/en/latest/cli_interface.html; WebFetch https://tox.wiki/en/latest/config.html.

  • tox (CLI) → signature from https://tox.wiki/en/latest/cli_interface.html; official text: “tox [ - h ] [ – colored { yes , no }] [ - v | - q ] [ – exit - and - dump - after seconds ] [ - c file ] [ – workdir dir ] [ – root dir ] [ – runner { virtualenv }] [ – version ] [ – no - provision [ REQ_JSON ]] [”
  • tox -e → signature from https://tox.wiki/en/latest/cli_interface.html; official text: “-e ENV- enumerate (ALL -> all environments, not set -> use <env_list> from config) (default: <env_list>)”
  • tox.ini → signature from https://tox.wiki/en/latest/config.html; official text: “For example: [tox] requires = tox >= 4.20 env_list = 3.14t 3.14 3.13 3.12 type”

FAQ

How do I test on multiple versions?
List them in envlist and tox creates each environment, skipping versions that are not installed unless skip_missing is disabled.
Can I reuse an environment?
Yes. tox -r recreates, while a plain run reuses the existing env, speeding up repeated runs.
How do I run in CI?
Set tox to run in CI mode so environments are rebuilt deterministically, typically via the CI environment variable.