← All notes

tox run -e starts one or more isolated test environments, and -f selects by factor

Answer: tox runs commands in named, isolated environments. tox run -e 3.13 runs one environment. tox run -e lint,3.13 runs several in order. tox run -f django runs every environment whose name contains the django factor. tox run -m test runs every environment with that label.

Selecting environments

Add -r to force recreation of the environment.

Why isolation matters

Each environment has its own install of the project and its test dependencies, so one Python version or extra set does not leak into another.

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: tox-dev/tox (GitHub), tox how-to: usage, MIT (https://raw.githubusercontent.com/tox-dev/tox/main/LICENSE); tox (tox.wiki), tox how-to: usage (website), MIT (https://raw.githubusercontent.com/tox-dev/tox/main/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: tox-dev/tox (GitHub), tox how-to: usage, MIT (https://raw.githubusercontent.com/tox-dev/tox/main/LICENSE); tox (tox.wiki), tox how-to: usage (website), MIT (https://raw.githubusercontent.com/tox-dev/tox/main/LICENSE).

Cite this

Permanent ID: iil:note:6xtrew8x

iinventedlight. 2026. "tox run -e starts one or more isolated test environments, and -f selects by factor." iinventedlight Library, iil:note:6xtrew8x, version of 2026-11-18. https://iinventedlight.com/library/notes/tox-environments/. License: CC-BY-4.0.

@misc{iil_note_6xtrew8x,
  author = {{iinventedlight}},
  title = {{tox run -e starts one or more isolated test environments, and -f selects by factor}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/tox-environments/},
  note = {Permanent ID iil:note:6xtrew8x. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/tox-environments.md.