[BUG] XML generated from coverage.py .coverage
doesn’t respect config
#648
Labels
codecov/codecov-cli
enhancement
New feature or request
Medium
Medium Priority Issues (to be fixed or re-evaluated in 3 months
Describe the bug
In my project, I configured coverage.py using
pyproject.toml
totest-files
folder (idk if that’s relevant)if TYPE_CHECKING:
blocksThe reported coverage reflects that (see table below), and when I run
coverage xml
, thetest-files/coverage.xml
file is also correct.But when the codecov CLI runs
coverage xml
via its coveragepy plugin, the lines are not skipped and codecov reports a 82.87% coverage instead of the expected 95.45% (see codecov report for the linked run below)See also Additional context below for a workaround I’m using
To Reproduce
report.exclude_also
setting in a pyproject.toml to ignore some lines.coverage
file and runcoverage xml
Expected behavior
either
coverage xml
run from the codecov CLI uses the same config as when I run it, or--file
already exists, have the codecov CLI skip runningcoverage xml
Regression
This probably worked using the old
coverage
PyPI package, but IDK.Screenshots
NA
Product Area
coverage
Versions
Commit and CI link
scverse/fast-array-utils@13436951846
https://github.com/scverse/fast-array-utils/actions/runs/13436951846/job/37541444988
Additional context
I can manually work around this by generating the XML myself and then deleting the
test-files/.coverage
file, but this should be fixed on your side.See scverse/fast-array-utils#29 for the workaround, which results in the correct coverage of 95.45% being reported.
The text was updated successfully, but these errors were encountered: