启用HTML报告时,是否禁用对STDOUT的鼻子覆盖报告? [英] Disabling nose coverage report to STDOUT when HTML report is enabled?
问题描述
我正在使用鼻子(通过覆盖插件,以检查我的Django项目的测试覆盖率.
I'm using nose (via django-nose) with the coverage plugin to check test coverage of my Django project.
我已经配置过鼻子以便在每次测试运行时生成HTML覆盖率报告:
I've configured nose to generate an HTML coverage report on every test run:
NOSE_ARGS = [
'--with-coverage',
'--cover-package=foot',
'--cover-html',
'--cover-html-dir=cover',
]
现在,我想禁用每次测试运行后都会显示的纯文本覆盖率报告; HTML的功能要强大得多,而且长格式错误的表格使得很难看到实际的测试输出. nosetests
和coverage
似乎都没有这样的选择,或者也许我找不到它?
Now, I want to disable the plain-text coverage report that gets shown after every test run; the HTML is much more functional, and the long badly-formatted table makes it hard to see actual test output. Neither nosetests
nor coverage
seems to have such an option, or perhaps I just can't find one?
推荐答案
pip install nose-cov
可以更好地控制报告选项.然后,将--with-coverage
更改为--with-cover
,例如
which has more control over reporting options. Then, change --with-coverage
to --with-cover
, e.g.
NOSE_ARGS = [
'--with-cov',
'--cov-report', 'html',
]
将导出为HTML但抑制控制台输出.
which will export to HTML but suppress console output.
这篇关于启用HTML报告时,是否禁用对STDOUT的鼻子覆盖报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!