Tox is a virtual environment manager for Python. It takes care of creating the environments and installing our project and all its dependencies on multiple Python versions.
It is a convenient tool that can automate the setup of our project environment and abstract it in a way that we can reuse the same command both locally and in our Continuous Integration (CI) pipeline to set up our project and run its tests. It also does that on multiple Python versions at the same time, so that we can check that our project works on all of them.
Testing multiple Python versions can be very convenient when you need to upgrade from one version to the next. Before switching all your systems to the new one, you want to ensure that your code is still able to work on both the old and new versions, so that you can perform a phased rollout.
If we take our contacts application example from Chapter 8, PyTest Essential Plugins, the test suite required many dependencies to run. We needed flaky...