【发布时间】:2012-03-08 06:52:37
【问题描述】:
是否有现成的插件可以像这样使用:
@nose.plugins.expectedfailure
def not_done_yet():
a = Thingamajig().fancynewthing()
assert a == "example"
如果测试失败,它看起来就像一个跳过的测试:
$ nosetests
...S..
..但如果它意外通过,它看起来类似于失败,可能像:
=================================
UNEXPECTED PASS: not_done_yet
---------------------------------
-- >> begin captured stdout << --
Things and etc
...
类似于like SkipTest,但没有实现为阻止测试运行的异常。
我唯一能找到的是 this ticket 关于支持 unittest2 expectedFailure 装饰器(虽然我宁愿不使用 unittest2,即使鼻子支持它)
【问题讨论】: