You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Paddle/python/paddle/v2/framework/tests/test_exception.py

18 lines
387 B

import paddle.v2.framework.core as core
import unittest
class TestException(unittest.TestCase):
def test_exception(self):
ex = None
try:
core.__unittest_throw_exception__()
except core.EnforceNotMet as ex:
self.assertIn("test exception", ex.message)
self.assertIsNotNone(ex)
if __name__ == "__main__":
unittest.main()