[New-bugs-announce] [issue40474] Code coverage report not entirely accurate

Lewis Ball report at bugs.python.org
Fri May 1 21:11:22 EDT 2020


New submission from Lewis Ball <lrjball at gmail.com>:

The current reported code coverage stats on codecov.io miss some global statements of modules imported before coveragepy begins. This is documented in the dev guide, and the suggested fix is here: https://devguide.python.org/coverage/#coverage-results-for-modules-imported-early-on but that recommended fix doesn't seem to be included in the CI.

Using the recommended 'hack', the coverage report shows an extra 4k lines are coverage in Lib, increasing coverage percentage by around 3%. 

Having a more accurate view of the coverage makes it much easier to see which parts of the code need help with tests, without having to go into every individual report to see if global statements are misreported.

I'll raise a PR for this shortly

----------
components: Tests
messages: 367904
nosy: Lewis Ball
priority: normal
severity: normal
status: open
title: Code coverage report not entirely accurate
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40474>
_______________________________________


More information about the New-bugs-announce mailing list