Use tox to create isolated Python environments, install the dependencies each environment needs, and run your project’s tests across the Python versions you choose to support. With tox 4, a new setup can live in tox.toml; run tox to test the default environment list, or select environments explicitly with tox run -e.
Set up tox 4 with a TOML configuration
The tox documentation project describes tox as a tool that creates virtual environments for multiple Python versions, installs project dependencies, and runs tests in each environment. The example below configures pytest for two Python versions. The version numbers are illustrative; choose interpreters that match your project’s supported Python versions and are available on your machine.
Create tox.toml in your project root:
env_list = ["3.13", "3.12"]
[env_run_base]
deps = ["pytest>=8"]
commands = [["pytest", { replace = "posargs", default = ["tests"], extend = true }]]
This sets the default environment list, installs pytest in each environment, and runs pytest against tests by default. The posargs replacement allows arguments supplied after -- on the tox command line to reach pytest.
Current tox documentation recommends TOML for new configuration: use tox.toml, or put the configuration under [tool.tox] in pyproject.toml. The documentation marks tox.ini and setup.cfg configuration as deprecated. If you maintain a project using one of those formats, consult the current tox 4.61.4 Getting Started guide before changing its configuration.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Install tox and prepare the project
Install tox using the method appropriate to your development environment, then make sure the Python interpreters named in env_list are available. This tutorial does not prescribe a particular installer or operating-system setup; the tox documentation’s Getting Started guide covers the initial setup.
- Put the configuration in the project root. Save the example as
tox.toml, beside the project’s source and tests. - Check the default test path. The example expects tests under
tests. Change the default in the command if your project uses another path. - Ignore tox’s working directory in version control. By default, tox creates virtual environments and stores them in
.toxbeside the configuration. Add.toxto your version-control ignore rules if it is not already ignored. - Run tox from the project root. tox creates the environments and installs the configured dependencies on the first run.
Run all or selected test environments
With the example configuration, these commands cover the most common choices:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
| Goal | Command |
|---|---|
Run every environment in env_list |
tox |
| Run only Python 3.13 | tox run -e 3.13 |
Run Python 3.13 and a configured lint environment |
tox run -e 3.13,lint |
| Pass pytest’s verbose flag through tox | tox run -e 3.13 -- -v |
The multi-environment example works when lint is configured in your tox setup. In the final command, -- separates tox’s options from pytest’s arguments; the posargs placeholder forwards -v to pytest. tox 4 documents environment selection and argument passing in its usage guide.
Understand environment reuse and installation
After the first run, tox normally reuses its environments. It refreshes them when dependencies change, but you can explicitly recreate an environment when you suspect it is stale:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
tox run -e 3.13 -r
Use --skip-env-install only when you deliberately want tox to run in an already prepared environment without performing installation. For example, it can be useful for a rerun when dependencies are already installed, including an offline scenario:
tox run -e 3.13 --skip-env-install
This option does not prepare missing dependencies. If the environment is new, incomplete, or out of date, use a normal run or recreate it instead. The tox usage guide documents these run options.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Run environments in parallel safely
Parallel execution can run selected environments together, which may reduce the elapsed time compared with running them sequentially. Keep sequential runs when they are easier to reason about, or when tests share state. In parallel pytest runs, give each environment its own temporary directory so simultaneous processes do not collide.
Add --basetemp={env_tmp_dir} to the pytest command in tox.toml:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
env_list = ["3.13", "3.12"]
[env_run_base]
deps = ["pytest>=8"]
commands = [["pytest", "--basetemp={env_tmp_dir}", { replace = "posargs", default = ["tests"], extend = true }]]
Then run the selected environments in parallel:
tox parallel -e 3.13,3.12
Use a separate temporary directory whenever concurrent test runs might otherwise write to the same location. The parallel command and temporary-directory pattern are documented in tox’s usage guide.
Inspect tox configuration and troubleshoot failures
Start by checking what tox resolved, then examine the environment that failed. These commands help distinguish a configuration issue from a test or environment issue:
- List configured environments:
tox list. - Inspect resolved settings:
tox config -e 3.13 -k deps commands. - Show more run detail:
tox run -e 3.13 -vv. - Review environment logs: inspect files under
.tox/<env_name>/log/, replacing<env_name>with the actual environment name. - Check the environment interactively:
tox exec -e 3.13 -- pythonortox exec -e 3.13 -- pip list.
If the environment appears stale, recreate it with tox run -e 3.13 -r. The current tox command reference documents the CLI commands; the usage guide provides workflow guidance.
Common causes and fixes
- A selected environment unexpectedly succeeds: tox can, by default, run an unconfigured environment name using defaults, so a typo may not fail as expected. Run
tox listand inspect the resolved configuration withtox config. - pytest cannot find tests: the example defaults to
tests. Confirm the directory exists or change the default test path in the command. - pytest does not receive a flag: put tox options before
--and pytest options after it, and ensure the configured command includes theposargsreplacement. - Parallel runs interfere with one another: configure
--basetemp={env_tmp_dir}so each environment uses its own temporary directory. - Dependencies or tools appear missing: a run using
--skip-env-installwill not install them. Run tox normally to install dependencies, or recreate the environment if it is stale.
Or skip the browser setup
For website screenshots in a development workflow, ScreenshotNeo is a screenshot API and MCP server for developers—not a replacement for tox or Python test execution. A single GET request can return an image or PDF. For example, this cURL request saves a WebP screenshot:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; these steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Learn about ScreenshotNeo or sign up free for 1,000 screenshots a month with no card.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




