Improve coverage testing and handling
Because the unittest and pytest runners handle the gabbi test suites and fixtures differently, testing coverage from just the unittest side is incomplete and potentially misleading. The changes here include: * adding a pytest-cov tox target to do coverage from pytest output is in html, put into the default 'htmlcov' directory (the cover target's output goes into the directory 'cover') * adding the pytest-cov module to test-requirements.txt * adjusting both coverage tests so coverage of the tests are not included in the reports, just the "real" code * adding the artifacts from these additions to .gitignore Sadly (but goodly), the result of these changes is that gabbi's coverage sorts are not as bigly as they should be. With the help of these new reports we'll make gabbi's test coverage great again.
This commit is contained in:
parent
1ea544754f
commit
3c1a4db019
2
.coveragerc
Normal file
2
.coveragerc
Normal file
@ -0,0 +1,2 @@
|
||||
[run]
|
||||
omit = gabbi/tests/*
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -10,4 +10,9 @@ AUTHORS
|
||||
ChangeLog
|
||||
# Generated by testrepository
|
||||
.testrepository
|
||||
.idea
|
||||
.idea
|
||||
.cache/
|
||||
# coverage related
|
||||
.coverage
|
||||
cover/
|
||||
htmlcov/
|
||||
|
@ -1,5 +1,6 @@
|
||||
mock ; python_version < '3.3'
|
||||
testrepository
|
||||
coverage
|
||||
pytest-cov
|
||||
hacking
|
||||
sphinx
|
||||
|
3
tox.ini
3
tox.ini
@ -44,6 +44,9 @@ commands = {toxinidir}/test-failskip.sh
|
||||
[testenv:cover]
|
||||
commands = python setup.py testr --coverage --testr-args="{posargs}"
|
||||
|
||||
[testenv:pytest-cov]
|
||||
commands = py.test --cov=gabbi gabbi/tests --cov-config .coveragerc --cov-report html
|
||||
|
||||
[testenv:docs]
|
||||
commands =
|
||||
rm -rf doc/build
|
||||
|
Loading…
Reference in New Issue
Block a user