【发布时间】:2011-09-08 17:45:00
【问题描述】:
我有很多项目正在以编程方式运行:
nosetest --with-coverage --cover-html-dir=happy-sauce/
问题在于,对于每个项目,coverage 模块都会覆盖 index.html 文件,而不是附加到它。有没有办法生成一个组合的 super-index.html 文件,其中包含我所有项目的结果?
谢谢。
【问题讨论】:
标签: python unit-testing nose
我有很多项目正在以编程方式运行:
nosetest --with-coverage --cover-html-dir=happy-sauce/
问题在于,对于每个项目,coverage 模块都会覆盖 index.html 文件,而不是附加到它。有没有办法生成一个组合的 super-index.html 文件,其中包含我所有项目的结果?
谢谢。
【问题讨论】:
标签: python unit-testing nose
您不能合并 HTML 目录。您可以合并 .coverage 数据文件,但您必须直接使用覆盖率,而不是通过鼻子:
$ 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
【讨论】:
nosetest --with-coverage 生成 .coverage 文件,是否有此标志? (鼻子测试版本 1.0.1)
nosetests --with-coverage -i project1/*.py -i project2/*.py
【讨论】: