简体   繁体   English

Nosetests和组合覆盖范围

[英]Nosetests & Combined Coverage

I have many projects that I'm programatically running: 我有许多以编程方式运行的项目:

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

The problem is that for each project, the coverage module overwrites the index.html file, instead of appending to it. 问题是,对于每个项目,coverage模块都会覆盖index.html文件,而不是附加到它。 Is there a way to generate a combined super-index.html file, that contains the results for all my projects? 有没有办法生成一个组合的super-index.html文件,其中包含我所有项目的结果?

Thanks. 谢谢。

You can't combine the HTML directories. 您无法组合HTML目录。 You can combine the .coverage data files, but you'll have to use coverage directly, rather than through nose: 您可以组合.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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM