pythonunit-testingcode-coveragecoverage.pypython-coverage

combine python coverage files?


I'm wondering if it's possible to combine coverage.xml files into 1 file to see global report in HTML output.

I've got my unit/functional tests running as 1 command and integration tests as the second command. That means my coverage for unit/functional tests are overridden by unit tests.

That would be great if I had some solution for that problem, mainly by combining those files into 1 file.


Solution

  • I found a different solution. I used combine feature (read here) So I run my coverage like: coverage run -p and then I do coverage combine.

    If you want to keep the old reports, you can use --keep.

    That's all. It generates 1 combined report.