kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Add expectedFailure decorator.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>pull/488/head
rodzic
8e82f3d80b
commit
377ebbfe56
|
@ -199,6 +199,18 @@ def skipUnless(cond, msg):
|
|||
return skip(msg)
|
||||
|
||||
|
||||
def expectedFailure(test):
|
||||
def test_exp_fail(*args, **kwargs):
|
||||
try:
|
||||
test(*args, **kwargs)
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
assert False, "unexpected success"
|
||||
|
||||
return test_exp_fail
|
||||
|
||||
|
||||
class TestSuite:
|
||||
def __init__(self):
|
||||
self._tests = []
|
||||
|
|
Ładowanie…
Reference in New Issue