nosetests --cover-html不生成html文档

Gok*_*kul 8 python code-coverage nosetests

我已经为python 2.6安装了鼻子,它工作正常,但我尝试使用该--cover-html选项生成一个HTML报告.我从命令行输入以下命令:

nosetests --cover-html
Run Code Online (Sandbox Code Playgroud)

它运行测试但没有生成html.

我错过了什么吗?

max*_*max 5

这是旧消息,但选项的顺序很重要:

nosetests --with-coverage --cover-erase --cover-html-dir=C:/temp/res --cover-html test.py
Run Code Online (Sandbox Code Playgroud)


Ned*_*der 2

您还需要--with-coverage首先启用覆盖率插件的选项。