Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of absolute paths from coverage.xml report generated by coverage.py

Tags:

coverage.py

Is there a way to get relative paths to resulted coverage.xml (or strip off prefix) using coverage.py?

like image 842
user2965111 Avatar asked Jan 20 '26 01:01

user2965111


1 Answers

Since coverage v5.0.4 you can set the relative_files option to True, e.g. in your .coveragerc:

[run]
relative_files=True

See this documentation section for reference and this Github issue for context.

like image 122
otterrisk Avatar answered Jan 22 '26 04:01

otterrisk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!