Adds test coverage in tox.ini

Coverage measurement will be helpful to gauge the effectiveness
of tests and maintain the quality of the code. Also changing
.gitignore to ignore the cover directory and .coverage
directories.

Change-Id: I184210af2d2e677b7cc2fe0c6561334ebc444fad
This commit is contained in:
Debayan Ray 2016-03-17 03:53:50 -07:00
parent a0b5470a52
commit 56bab01427
3 changed files with 16 additions and 1 deletions

3
.gitignore vendored
View File

@ -28,6 +28,9 @@ pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
cover/
.coverage*
!.coveragerc
htmlcov/
.tox/
.coverage

View File

@ -1,5 +1,6 @@
mock
hacking>=0.9.2,<0.10
coverage>=3.6 # Apache-2.0
testrepository>=0.0.18
testtools>=1.4.0 # MIT
os-testr>=0.4.1 # Apache-2.0

13
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = py34,py27,pep8
envlist = py34,py27,pep8,cover
[testenv]
usedevelop = True
@ -20,6 +20,17 @@ deps =
commands =
flake8 proliantutils
[testenv:cover]
# After running this target, visit proliantutils/htmlcov/index.html
# in your browser, to see a nicer presentation report with annotated
# HTML listings detailing missed lines.
basepython = python2.7
deps = {[testenv]deps}
commands = coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
coverage report --omit=*test*
coverage html --omit=*test*
[flake8]
max-complexity=15