Refining test coverage

This patch excludes the test artifacts from coverage results.
It uses coverage lib, already included in test-requirements,
to put the coverage results in 'cover' folder and displays
the report as well as part of tox `cover` target.

Change-Id: Ib6dd8558dc5db4025b27c660690d0c31fd983367
This commit is contained in:
Debayan Ray 2017-02-28 01:10:44 -05:00
parent 37fcd7ef8f
commit 44cd454dbd
2 changed files with 10 additions and 1 deletions

View File

@ -4,3 +4,6 @@ source = sushy
[report]
ignore_errors = True
[html]
directory = cover

View File

@ -19,7 +19,13 @@ commands = flake8 {posargs}
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
# After running this target, visit sushy/cover/index.html
# in your browser, to see a nicer presentation report with annotated
# HTML listings detailing missed lines.
commands = coverage erase
python setup.py test --coverage --testr-args='{posargs}'
coverage report --omit=*test*
coverage html --omit=*test*
[testenv:docs]
commands = python setup.py build_sphinx