Python Coverage File Not Found

Hello,

I’m glad you found another workaround to your problem. For the record, I’ll try to give you pointers into getting this to work entirely with SonarCloud.

In the last example, your properties settings seem a bit weird to me.
You have this error in your logs:
10:17:11.703 ERROR: Invalid value of sonar.tests for Snayff_notquiteparadise

Also I believe if you want to refer to a folder, you don’t need to add /** at its end, as the subdirectories are automatically included.

So my suggestion would be to try to replace sonar.test.inclusions=tests/** with sonar.tests=tests instead.

If you do that, when importing your code coverage, you might also encounter a problem with incorrect file paths in your coverage file, which you can fix following the advice from this thread:

Here’s a sample Python project that deals with this:

Hope that helps,
Guillaume

2 Likes