Skip to content

Report hasn't the TOTAL line if one file is tested only  #922

Closed
@mosling

Description

@mosling

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.

  1. Python 3.8.0
  2. Coverage.py, version 5.0.3 with C extension
  3. 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 ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or requestreportwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions