Fix an issue where no test coverage report is created

Running `tox -ecover` does not generate the coverage report.
Instead the following is displayed to the user:

    No coverage report, but warnings instead:
    Coverage.py warning: Module nova-dpm was never imported.

This patch set fixes the problem.

Change-Id: Iec85cf3a6453da3630d49df29c69b55ca5075d17
Closes-Bug: #1655920
This commit is contained in:
Tin Lam 2017-01-13 15:54:07 -06:00
parent 42f8e1f6c3
commit ce0676d3d8
2 changed files with 5 additions and 1 deletions

View File

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

View File

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