示例#1
0
 def wrapper(self):
     if self.test_data['xfail']:
         try:
             func(self)
         except Exception:
             raise testcase._ExpectedFailure(sys.exc_info())
         raise testcase._UnexpectedSuccess
     else:
         func(self)
示例#2
0
文件: case.py 项目: jasonamyers/gabbi
 def wrapper(self):
     if self.test_data['xfail']:
         try:
             func(self)
         except Exception:
             raise testcase._ExpectedFailure(sys.exc_info())
         raise testcase._UnexpectedSuccess
     else:
         func(self)
示例#3
0
 def wrapper(self):
     if self.test_data['xfail']:
         try:
             func(self)
         except Exception:
             if hasattr(testcase, '_ExpectedFailure'):
                 raise testcase._ExpectedFailure(sys.exc_info())
             else:
                 self._addExpectedFailure(self.result, sys.exc_info())
         else:
             if hasattr(self, '_addUnexpectedSuccess'):
                 self._addUnexpectedSuccess(self.result)
             else:
                 raise testcase._UnexpectedSuccess
     else:
         func(self)
示例#4
0
文件: case.py 项目: cdent/gabbi
 def wrapper(self):
     if self.test_data['xfail']:
         try:
             func(self)
         except Exception:
             if hasattr(testcase, '_ExpectedFailure'):
                 raise testcase._ExpectedFailure(sys.exc_info())
             else:
                 self._addExpectedFailure(self.result, sys.exc_info())
         else:
             if hasattr(self, '_addUnexpectedSuccess'):
                 self._addUnexpectedSuccess(self.result)
             else:
                 raise testcase._UnexpectedSuccess
     else:
         func(self)