[tox] add 'coverage' toxenv to make local html coverage report

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.
This commit is contained in:
Cosimo Lupo 2016-10-14 15:18:28 +01:00
parent 7adfe98690
commit 907af836c0

13
tox.ini
View File

@ -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