kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Accept message for assert*().
rodzic
3ff262e08f
commit
4963237025
|
@ -1,19 +1,19 @@
|
||||||
class TestCase:
|
class TestCase:
|
||||||
|
|
||||||
def fail(self, msg):
|
def fail(self, msg=''):
|
||||||
assert False, msg
|
assert False, msg
|
||||||
|
|
||||||
def assertEqual(self, x, y):
|
def assertEqual(self, x, y, msg=''):
|
||||||
assert x == y, "%r vs %r" % (x, y)
|
assert x == y, "%r vs %r" % (x, y)
|
||||||
|
|
||||||
def assertTrue(self, x):
|
def assertTrue(self, x, msg=''):
|
||||||
assert x
|
assert x, msg
|
||||||
|
|
||||||
def assertIn(self, x, y):
|
def assertIn(self, x, y, msg=''):
|
||||||
assert x in y
|
assert x in y, msg
|
||||||
|
|
||||||
def assertIsInstance(self, x, y):
|
def assertIsInstance(self, x, y, msg=''):
|
||||||
assert isinstance(x, y)
|
assert isinstance(x, y), msg
|
||||||
|
|
||||||
def assertRaises(self, exc, func, *args):
|
def assertRaises(self, exc, func, *args):
|
||||||
try:
|
try:
|
||||||
|
|
Ładowanie…
Reference in New Issue