diff --git a/unittest/setup.py b/unittest/setup.py index 964603f6..7afb5ca4 100644 --- a/unittest/setup.py +++ b/unittest/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='micropython-unittest', - version='0.0.4', + version='0.0.5', description='Reimplementation of unittest package for MicroPython', url='https://github.com/micropython/micropython/issues/405', author='MicroPython Developers', diff --git a/unittest/unittest.py b/unittest/unittest.py index 0dc4cb3a..cab783b0 100644 --- a/unittest/unittest.py +++ b/unittest/unittest.py @@ -4,7 +4,14 @@ class TestCase: assert False, msg def assertEqual(self, x, y, msg=''): - assert x == y, "%r vs (expected) %r" % (x, y) + if not msg: + msg = "%r vs (expected) %r" % (x, y) + assert x == y, msg + + def assertIs(self, x, y, msg=''): + if not msg: + msg = "%r is not %r" % (x, y) + assert x is y, msg def assertTrue(self, x, msg=''): assert x, msg