鼻子测试和综合覆盖

2024-06-01 08:27:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我有很多项目都是通过程序运行的:

nosetest --with-coverage --cover-html-dir=happy-sauce/

问题是,对于每个项目,覆盖模块覆盖索引.html文件,而不是附加到它。有没有办法产生一个组合超级-索引.html文件,它包含我所有项目的结果?在

谢谢。在


Tags: 模块文件项目程序运行htmldirwithcoverage
2条回答

不能合并HTML目录。您可以合并.coverage数据文件,但必须直接使用coverage,而不是通过nose:

$ nosetest  with-coverage proj1
$ mv .coverage .coverage.1
$ nosetest  with-coverage proj2
$ mv .coverage .coverage.2
$ coverage combine
(combines .coverage.1 and .coverage.2 into a new .coverage)
$ coverage html  directory=happy-sauce

nosetests with-coverage -i project1/*.py -i project2/*.py

相关问题 更多 >