diff --git a/.gitignore b/.gitignore index 6401b540..c1f411fe 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports +cover/ +.coverage* +!.coveragerc htmlcov/ .tox/ .coverage diff --git a/test-requirements.txt b/test-requirements.txt index 40087a7e..8e77bdfd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index a864a6d9..2524ea98 100644 --- a/tox.ini +++ b/tox.ini @@ -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