Make coverage tests work

The default package name for coverage doesn't work, so we need to
explicitly state it in tox.ini. We should also exclude the tests
directory as that code will typically be 100% tested, and if it's
not we don't really care.  Also excludes the coverage results from
git so it doesn't show up in git status.

Change-Id: I9e99b2c7c215a5de3c76cb2daf0f468f445774c3
This commit is contained in:
Ben Nemec 2015-11-30 22:20:31 +00:00
parent a7841162ff
commit 170c0a9eb2
3 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[run]
branch = True
source = tripleo_common
omit = tripleo_common/openstack/*
omit = tripleo_common/tests/*
[report]
ignore_errors = True

1
.gitignore vendored
View File

@ -23,6 +23,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
cover
.tox
nosetests.xml
.testrepository

View File

@ -19,7 +19,7 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
commands = python setup.py test --coverage --coverage-package-name=tripleo_common --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx