提交 ba4b0291 编写于 作者: Y Yu Yang

Follow comments, check exception message

上级 680c2021
...@@ -4,8 +4,13 @@ import unittest ...@@ -4,8 +4,13 @@ import unittest
class TestException(unittest.TestCase): class TestException(unittest.TestCase):
def test_exception(self): def test_exception(self):
self.assertRaises(core.EnforceNotMet, ex = None
lambda: core.__unittest_throw_exception__()) try:
core.__unittest_throw_exception__()
except core.EnforceNotMet as ex:
self.assertIn("test exception", ex.message)
self.assertIsNotNone(ex)
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册