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
- id: C1 claim: tox run -e starts a specific environment. source: S1 evidence: "Run a specific environment: `
tox run -e 3.13`"
- id: C2 claim: A factor selects every matching environment. source: S1 evidence: "Run all environments matching a factor"
- id: C3 claim: The published how-to documents the same tox run -e form. source: S2 evidence: "tox run -e 3.13"
- id: C4 claim: The published how-to also documents factor selection. source: S2 evidence: "matching a factor"
Sources
- [S1] tox how-to: usage. tox-dev/tox (GitHub). https://github.com/tox-dev/tox/blob/main/docs/how-to/usage.rst . License: MIT. Accessed 2026-11-18.
- [S2] tox how-to: usage (website). tox (tox.wiki). https://tox.wiki/en/latest/how-to/usage.html . License: MIT. Accessed 2026-11-18.
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
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.},
}
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.