test_exception.py 387 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6
import paddle.v2.framework.core as core
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()