简体   繁体   English

将nosetests覆盖范围限制为仅运行的测试

[英]Restrict nosetests coverage to only the tests that were run

Is there a way to have nosetests restrict the coverage information to only the tests that were run? 有没有办法让nosetests将覆盖范围信息限制为仅运行的测试?

I know about the cover-package flag, but it would be nicer if you didn't have to specify the package. 我知道cover-package标志,但如果你不必指定包,它会更好。

This would be especially useful when running aa single unit test class that lives in a file with multiple unit test classes. 当运行位于具有多个单元测试类的文件中的单个单元测试类时,这将特别有用。

Unfortunately I do not know of a way in nosetests to perform this action. 不幸的是,我不知道在测试中如何执行此操作。 I actually ended up uninstalling nosetests and using just coverage.py because it seems like nosetests and coverage don't play nicely together. 我实际上最终卸载了nosetests并且只使用了coverage.py,因为看起来像nosetests和coverage不能很好地一起玩。 I know for a fact you can specify down to individual test methods what you want to run. 我知道您可以指定您想要运行的各个测试方法。 I'm not sure if that's exactly what you are looking for but I beat my head against a brick wall for days trying to get nosetests to cooperate with no luck. 我不确定这是不是你正在寻找的东西,但是我几天试着让鼻子试试合作没有运气。 Maybe it would save some effort to switch and run coverage.py directly instead? 也许它会省去一些努力直接切换和运行coverage.py

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

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