Skip to content

Add support for multiversion testing with tox

Barry Warsaw requested to merge tox into master

Okay, I'm pretty stalled with my Python 2.7 branch, so I refactored out support for running all the tests with tox. I set up Python 3.4, 3.5, 3.6, and 3.7 environments, with generated environments for:

  • no coverage - just runs the test suite
  • coverage - must pass 100% (liberally pragma'd :)
  • diffcov - 100% of any new PR changed lines must be covered

I also added a qa environment for flake8 and a docs environment for creating the Sphinx docs, though that latter is not run by default.

So for example if you want to see what the coverage is under Python 3.5, run tox -e py35-cov or under 3.7 without coverage: tox -e py37-nocov and so on.

Coverage pragmas:

  • geXY - these lines can be skipped when the Python version is not greater than or equal to X.Y
  • leXY - these lines can be skipped when the Python version is not less than or equal to X.Y

I don't have Python 3.4 installed.

Merge request reports