tox aims to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software.

acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing.

running your tests in each of the environments, configuring your test tool of choice

checking that your package installs correctly with different Python versions and interpreters

tox is a generic virtualenv management and test command line tool you can use for:

Basic example¶

First, install tox with pip install tox . Then put basic information about your project and the test environments you want your project to run in into a tox.ini file residing right next to your setup.py file:

# content of: tox.ini , put in same dir as setup.py [tox] envlist = py27,py36 [testenv] # install pytest in the virtualenv where commands will be executed deps = pytest commands = # NOTE: you can run any command line tool here - not just tests pytest

You can also try generating a tox.ini file automatically, by running tox-quickstart and then answering a few simple questions.

To sdist-package, install and test your project against Python2.7 and Python3.6, just type:

tox