Esempio n. 1
0
    def _test_create_message(self, error_data):
        self.filepath = inspect.getfile(unwrap(self.func))
        self.set_message()
        error_message = error_data.create_message()

        self.assertIn('In user code:', error_message)
        for m in self.expected_message:
            self.assertIn(m, error_message)
Esempio n. 2
0
 def setUp(self):
     self.set_input()
     self.set_func()
     self.set_func_call()
     self.filepath = inspect.getfile(unwrap(self.func_call))
     self.set_exception_type()
     self.set_message()
     self.prog_trans = paddle.jit.ProgramTranslator()
Esempio n. 3
0
    def _test_create_message(self, error_data):
        self.filepath = inspect.getfile(unwrap(self.func))
        self.set_message()

        with self.assertRaises(ValueError):
            error_data.create_message()

        error_data.in_runtime = False
        error_message = error_data.create_message()

        self.assertIn('In user code:', error_message)
        for m in self.expected_message:
            self.assertIn(m, error_message)
Esempio n. 4
0
 def setUp(self):
     self.reset_flags_to_default()
     self.set_func_call()
     self.filepath = inspect.getfile(unwrap(self.func_call))
     self.set_exception_type()
     self.set_message()
Esempio n. 5
0
 def set_func_call(self):
     self.func_call = lambda: self.prog_trans.get_output(
         unwrap(self.func), self.input)