Exercises
Working with tox is even more fun than reading about it. Running through these exercises will help you realize how simple it is to work with tox. A small starter project with a starter tox.ini set to run tests using Python 3.10 is in the /path/to/code/exercises/ch11 folder. Use that project to complete the following exercises.
-
Go to /path/to/code/exercises/ch11. Install tox.
-
Run tox with the current settings.
-
Change envlist to also run Python 3.9.
-
Change commands to add coverage report, including making sure there is 100% coverage. Don’t forget to add pytest-cov to deps.
-
Add {posargs} to the end of the pytest command. Run tox -e py310 -- -v to see the test names.
-
(Bonus) Set up GitHub Actions to run tox for this project, or some other ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access