pants
pants copied to clipboard
Python raw coverage report shows 0%
Describe the bug When generating a raw coverage report, it shows all files as 0% covered.
Pants version 2.17.0
OS MacOS
Additional info Reproducing repository with instructions: https://github.com/idan-at/pants-coverage-test
Hi,
You are missing relative_files = true
under your [run]
section in .coveragerc
. Per the documentation, this is required for Pants to work. Adding this produces the expected output in your HTML report generated by check.py
in your repository:
Thanks John, I totally missed the docs for that. Closing this issue.
Hm, I think there's something deeper going on here: Pants attempts to set that property itself, but that is seemingly not working: https://github.com/pantsbuild/pants/blob/e4aaf382459c4362450440b8c20518af446f686c/src/python/pants/backend/python/goals/coverage_py.py#L276-L298
As such, reopening.
I've tried updating the filename of the config from the example above to end with .toml
, didn't help