Tox Support
IntelliJ IDEA integrates with tox and allows running tests in multiple environments.
Configure tox
Ensure that Python is downloaded and installed on your machine.
Ensure that at least one Python SDK is configured.
Install tox for the Python SDK.
Ensure that your project has the following files:
tox.ini
test files
Execute tox tests
Record the test requirements in the tox.ini file.
Example:
[tox] envlist = py310 py312 [testenv] deps = pytest pytest-bdd commands = pytestSee the tox documentation for more details.
Right-click the file tox.ini and choose Run. The dedicated tox run/debug configuration is launched.
The results show up in the test runner tab of the Run tool window:
Right-click any test result in the Test Runner to execute tox in a particular environment:
The test tree view shows only for those runners that IntelliJ IDEA is aware of. If IntelliJ IDEA doesn't understand the test runner, then the interpreter name only is written.