SonarQube Developer Edition Version 9.4 (build 54424)
Trying to get accurate coverage in python
I am getting this warning… Do you know how to fix it?
The following error(s) occurred while trying to import coverage report:
Cannot resolve the file path '__init__.py' of the coverage report, ambiguity, the file exists in several 'source'.%nCannot resolve 5 file paths, ignoring coverage measures for those files
Welcome to our community!
It looks like the coverage report contains 5 file having just __init__.py as file path, so the analyzer is not able to tell what files it’s referring to.
Could you please share with us how you generate coverage report?
hi @adric1 ,
Sorry for late reply. Is it expected to have also tests as source in .coveragerc? If I’m not mistaken this means test files are also taken into account in coverage computation.
source =
utils
tests
Could you please share coverage-reports/coverage-report.xml?