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)
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)