Skip to content

Instantly share code, notes, and snippets.

@luchiago
Created July 9, 2020 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luchiago/ac6c29cda5cc3a73001a0cc6005b50ed to your computer and use it in GitHub Desktop.
Save luchiago/ac6c29cda5cc3a73001a0cc6005b50ed to your computer and use it in GitHub Desktop.
[BACKEND][PYTHON][DJANGO] Notes about Tox

Tox

According to official website, 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.

What is tox?

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

  • checking your package installs correctly with different Python versions and interpreters
  • running your tests in each of the environments, configuring your test tool of choice
  • acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing.

Usage

You can install tox from PyPi using the command pip install tox. After configuring a tox.ini fie you can run tox and see if everything is correct

The config file

You can put the basic information about your project and the test environments you want your project to run into a tox.ini file. It should be placed on the root of the project and can be generated with the command tox-quickstart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment