test_exception.py 383 字节
Newer Older
Q
Qiao Longfei 已提交
1
import paddle.v2.fluid.core as core
Y
Yu Yang 已提交
2 3 4 5 6
import unittest


class TestException(unittest.TestCase):
    def test_exception(self):
7 8 9 10 11 12 13
        ex = None
        try:
            core.__unittest_throw_exception__()
        except core.EnforceNotMet as ex:
            self.assertIn("test exception", ex.message)

        self.assertIsNotNone(ex)
Y
Yu Yang 已提交
14 15 16 17


if __name__ == "__main__":
    unittest.main()