coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Ability to report pragma no cover as being covered (codecov related)

Open ssbarnea opened this issue 2 years ago • 1 comments

As codecov.io does not have support for pragma no cover comments we need need to find a way to produce some coverage reports that report the "skipped" lines as being covered, so they will display accordingly in their web interface.

Is your feature request related to a problem? Please describe.

Describe the solution you'd like Ideally we would have a configurable option as "no_pragma_as_covered: true" that changes the way the reports are created.

Currently we upload coverage.xml report to codecov.io

Describe alternatives you've considered I am not aware of any alternative to make the codecov coverage tracking in sync with coverage.py reporting.

Additional context

  • https://community.codecov.com/t/pragma-no-cover-is-still-being-covered/1128

ssbarnea avatar Jan 17 '23 12:01 ssbarnea

@ssbarnea Can you provide more detail about what isn't working with codecov.io?

Using # pragma: no cover seems to be working here:

https://app.codecov.io/gh/ansible/ansible/blob/devel/test%2Funits%2Fansible_test%2Ftest_diff.py#L8

image

  Using # pragma: nocover seems to be working here:

https://app.codecov.io/gh/ansible/ansible/blob/devel/test%2Funits%2Fplaybook%2Frole%2Ftest_include_role.py#L202

image

mattclay avatar Jun 27 '23 20:06 mattclay