kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Add dummy TestCase.subTest() context manager.
Just runs "subtests" in the scope of the main TestCase. Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>pull/488/head
rodzic
7d77774027
commit
555f28ce6d
|
@ -29,10 +29,21 @@ class AssertRaisesContext:
|
|||
return False
|
||||
|
||||
|
||||
class NullContext:
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
def __exit__(self, a, b, c):
|
||||
pass
|
||||
|
||||
|
||||
class TestCase:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def subTest(self, msg=None, **params):
|
||||
return NullContext()
|
||||
|
||||
def skipTest(self, reason):
|
||||
raise SkipTest(reason)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue