示例#1
0
文件: annt.py 项目: jags14385/JATR
 def __call__(self, original_func):
     self.test_name = original_func.__name__
     self.f = original_func
     self.f(self)
     self._parseAssertions()
     test_file_src_path = inspect.getsourcefile(original_func)
     verif_errs_list = globals().get('assertion_status')
     Reporter.add_test_report(TestReport(self.test_name,self.status,verif_errs_list,test_file_src_path))
     del verif_errs_list[:]
示例#2
0
文件: marker.py 项目: jags14385/JATR
 def _inner_func(*args, **kwargs):
     test_file_src_path = inspect.getsourcefile(original_func)
     if ReadConfig().marker in self.marker :
             test_fixture_name = TestRun.get_class_name(test_file_src_path, ReadConfig().test_case_fixture_suffix)
             fixture_import_handle = Utilities.get_fixture_from_path(test_file_src_path)
             fixture_obj = getattr(fixture_import_handle, test_fixture_name)()
             try:
                 getattr(fixture_obj, 'setup')()
                 sa = Verify()
                 sa.__call__(original_func)
             except AssertionError :
                 Reporter.add_test_report(TestReport(original_func.__name__,"FAILED",[traceback.format_exc()],test_file_src_path))
                 verif_errs_list = globals().get('assertion_status')
                 del verif_errs_list
             except :
                 Reporter.add_test_report(TestReport(original_func.__name__,"Exception",[],test_file_src_path))
             finally:
                 getattr(fixture_obj, 'teardown')()
     else:
         Reporter.add_test_report(TestReport(original_func.__name__,"SKIPPED",[],test_file_src_path))