结合python coverage文件? [英] combine python coverage files?
问题描述
我想知道是否可以将 coverage.xml
文件合并为1个文件,以查看HTML输出中的全局报告。
I'm wondering if it's possible to combine coverage.xml
files into 1 file to see global report in HTML output.
我已经将我的单元/功能测试
作为1条命令运行,并且将集成测试
作为第二条命令命令。这意味着我对单元/功能测试
的覆盖范围被单元测试
覆盖。
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
.
如果我有解决这个问题的方法,那很好,主要是将这些文件合并为1个文件。
That would be great if I had some solution for that problem, mainly by combining those files into 1 file.
推荐答案
我找到了另一个解决方案。我使用了 combine
功能(在此处阅读)
因此,我将覆盖范围运行为: coverage run -p
,然后执行 coverage Combine
。
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
.
仅此而已。它会生成1个合并报告。
That's all. It generates 1 combined report.
这篇关于结合python coverage文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!