Browse Source

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 networking-dpm was never imported.

This patch set fixes the problem.

Change-Id: Ia2f88e4899536e935e243200093d9855f2c56dbc
Andreas Scheuring 2 years ago
parent
commit
df600774c0
2 changed files with 5 additions and 1 deletions
  1. 1
    0
      .coveragerc
  2. 4
    1
      tox.ini

+ 1
- 0
.coveragerc View File

@@ -1,6 +1,7 @@
1 1
 [run]
2 2
 branch = True
3 3
 source = os_dpm
4
+omit = os_dpm/tests/*
4 5
 
5 6
 [report]
6 7
 ignore_errors = True

+ 4
- 1
tox.ini View File

@@ -22,7 +22,10 @@ commands = flake8 {posargs}
22 22
 commands = {posargs}
23 23
 
24 24
 [testenv:cover]
25
-commands = python setup.py test --coverage --testr-args='{posargs}'
25
+commands =
26
+  coverage erase
27
+  python setup.py test --coverage --coverage-package-name=os_dpm --testr-args='{posargs}'
28
+  coverage report
26 29
 
27 30
 [testenv:docs]
28 31
 commands = python setup.py build_sphinx

Loading…
Cancel
Save