From 907af836c07dc9aeefb431581aea2e30d2bab496 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 14 Oct 2016 15:18:28 +0100 Subject: [PATCH] =?UTF-8?q?[tox]=20add=20'coverage'=20toxenv=20to=20make?= =?UTF-8?q?=C2=A0local=20html=20coverage=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful if one wants to run coverage tests locally, and get a nice HTML report while one is writing tests. Just run: $ tox -e coverage -- {optional pytest arguments} And you get a "htmlcov/index.html" to view in your browser. --- tox.ini | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index f4b1600a6..9118d2697 100644 --- a/tox.ini +++ b/tox.ini @@ -16,12 +16,21 @@ commands = # run the test suite against the package installed inside tox env py.test {posargs:--pyargs fontTools} +[testenv:coverage] +basepython = {env:TOXPYTHON:python3.5} +deps = + {[testenv]deps} + pytest-cov +skip_install = true +commands= + # measure test coverage and create html report + py.test --cov --cov-report html {posargs} + [testenv:coveralls] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH basepython=python3.5 deps = - {[testenv]deps} - pytest-cov + {[testenv:coverage]deps} coveralls skip_install = true ignore_outcome = true