如何在 Eclipse 中获取单元测试覆盖率结果 +皮德夫?
我知道 Eclipse + PyDev 有一个选项 Run As
=>; 3 Python 覆盖率
。但它所报告的只是:
在 0.001 秒内运行 6 次测试
确定
并且它没有说明代码覆盖率。如何在 Pydev 中获取代码覆盖率报告?
I know Eclipse + PyDev has an option Run As
=> 3 Python Coverage
. But all it reports is:
Ran 6 tests in 0.001s
OK
And it says nothing about code coverage. How to get a code coverage report in Pydev?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
其实这是一个非常好的功能,没有之前不知道:)
Actually this is a really nice feature, didn't know about it before :)
请注意,在 pydev 2.0 中,覆盖率支持发生了变化,现在,您应该首先打开覆盖率视图并选择“为新启动启用代码覆盖率”...之后,您所做的任何启动(常规或单元测试)都将具有收集覆盖率信息(结果检查也变得更加直观)。
Note that in pydev 2.0, the coverage support changed, now, you should first open the coverage view and select the 'enable code coverage for new launches'... after that, any launch you do (regular or unit-test) will have coverage information being gathered (and the results inspection also became a bit more intuitive).
看看这是否有帮助 http://www.machine-envy.com/blog/2006/07/29/automated-python-testing-with-nose-and-eclipse/
它使用带有
–with- 的鼻子测试覆盖范围
选项。See if this helps http://www.machine-envy.com/blog/2006/07/29/automated-python-testing-with-nose-and-eclipse/
It uses nosetests with the
–with-coverage
option.