让 Nose 无法通过缓慢的测试
我希望我的测试如果运行时间超过一定时间(比如 500 毫秒)就会失败,因为当加载一些稍慢的测试负载并且每次运行测试套件时突然出现这么大的延迟时,情况会很糟糕。 Nose 是否有任何插件或其他东西可以做到这一点?
I want to my tests to fail if they take longer than a certain time to run (say 500ms) because it sucks when a load of slightly slow tests mount up and suddenly you have this big delay every time you run the test suite. Are there any plugins or anything for Nose that do this already?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于时间很重要的情况(例如实时要求):
http://nose.readthedocs.org/en/latest /testing_tools.html
For cases where where timing is important (e.g. realtime requirements):
http://nose.readthedocs.org/en/latest/testing_tools.html
我谨建议改变“破碎”的含义是一个坏主意。
失败/“红色”测试的含义不应该是“此功能已损坏”以外的任何内容。做任何其他事情都有可能削弱测试的价值。
如果您实施了此操作,然后下周少数测试失败,这是否表明
我建议最好从构建过程中收集 MI 并对其进行监视,以便发现缓慢的测试构建,但让红色表示“损坏的功能”而不是“损坏的功能和/或缓慢的测试”。
I respectfully suggest that changing the meaning of "broken" is a bad idea.
The meaning of a failed/"red" test should never be anything other than "this functionality is broken". To do anything else risks diluting the value of the tests.
If you implement this and then next week a handful of tests fail, would it be an indicator that
I suggest it would be better to gather MI from your build process and monitor it in order to spot slow tests building up, but let red mean "broken functionality" rather then "broken functionality and/or slow test."