Report hasn't the TOTAL line if one file is tested only · Issue #922 · nedbat/coveragepy (original) (raw)
Describe the bug
A very simple setup, I have one python script (script.py) and a test for this script (script_test.py).
The result for coverage run -m pytest
and coverage report
is
Name Stmts Miss Cover
-----------------------------------
adder.py 2 0 100%
adder_test.py 7 1 86%
-----------------------------------
TOTAL 9 1 89%
But the same with coverage run --omit='*_test.py' -m pytest
and coverage report
results into
Name Stmts Miss Cover
------------------------------
adder.py 2 0 100%
The summary line with TOTAL is missing
I use GitLab and look for the TOTAL line to catch the test coverage.
To Reproduce
How can we reproduce the problem? Please be specific.
- Python 3.8.0
- Coverage.py, version 5.0.3 with C extension
- Example project at https://github.com/mosling/coverage-example
Expected behavior
TOTAL line should appear in every case. It is important for data processing to have the same behavior in each case, I never see the output ;-)