Python Unit Test Coverage always reports as 0%

I am testing out sonarcloud on one of our smaller projects to determine if it will be purchased for our team. I am just running the scanner locally at the moment. I have run my build and unit testing. The coverage.xml is present, I also added our junit xml to the scanner properties as well. When I run the scanner I get all of my data except coverage. It shows as 0% for all files, even though the coverage is well over 95%.

12:14:23.275 INFO: 6/6 source files have been analyzed
12:14:23.275 INFO: The Python analyzer was able to leverage cached data from previous analyses for 0 out of 6 files. These files were not parsed.
12:14:23.275 INFO: Sensor Python Sensor [python] (done) | time=3001ms
12:14:23.275 INFO: Sensor Cobertura Sensor for Python coverage [python]
12:14:23.276 DEBUG: Using pattern './coverage.xml' to find reports
12:14:23.639 INFO: Python test coverage
12:14:23.640 INFO: Parsing report 'C:\MTRepos\XXXXXX\.\coverage.xml'
12:14:23.698 INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=423ms
12:14:23.698 INFO: Sensor PythonXUnitSensor [python]

my properties file looks like this:


# This is the name and version displayed in the SonarCloud UI.

# Path is relative to the file. Replace "\" by "/" on Windows.

# Encoding of the source code. Default is default system encoding

sonar.exclusions=**/tests/**, **/venv/**

my coverage xml shows:

<?xml version="1.0" ?>
<coverage version="7.4.0" timestamp="1707327992025" lines-valid="178" lines-covered="178" line-rate="1" branches-valid="36" branches-covered="36" branch-rate="1" complexity="0">
	<!-- Generated by -->
	<!-- Based on -->

I have searched through many topics here and none of the suggestions seem to help. Im not sure what to try next.


Welcome to the community!

Nothing’s jumping out at me. Since you’re apparently running debug logging, I’d have expected a bit more in the log if there were a problem with the coverage report.

Can you go ahead & provide the full debug analysis log?

As a side note, this does nothing: