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
Paul Sokolovsky 2020-08-09 11:58:19 +03:00 zatwierdzone przez Andrew Leech
rodzic 7d77774027
commit 555f28ce6d
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -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)