Managing Test Environments with Tox

In the previous chapter, we covered the most frequently used PyTest plugins. Through them, we are able to manage our test suite within a Python environment. We can configure how the test suite should work, as well as enable coverage reporting, benchmarking, and many more features that make it convenient to work with our tests. But what we can't do is manage the Python environment itself within which the test suite runs.

Tox was invented precisely for that purpose; managing Python versions and the environment that we need to run our tests. Tox takes care of setting up the libraries and frameworks we need for our test suite to run and will check our tests on all Python versions that are available.

In this ...

Get Crafting Test-Driven Software with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.