def test_get_real_last_traceback_w_exception_in_old_style_class(self): class OldStyleClass: def throw(self): raise Exception('exception in OldStyleClass') try: OldStyleClass().throw() except Exception as e: util.get_real_last_traceback(e)
def execute(self, context=None): kwargs = {} if self.execute_kwargs: kwargs.update(self.execute_kwargs) self.start() try: types.MethodType(self.case_func, context or self)(**kwargs) except TestIncompleteException as e: self.incomplete = True # If thrown during decorators if e.real_func: self.case_func = e.real_func except TestSkippedException as e: self.skipped = True self.skip_reason = e.reason if type(e.reason) is str else '' # If thrown during decorators if e.real_func: self.case_func = e.real_func except FailedRequireException: pass except Exception as e: self.error = get_real_last_traceback(e) self.stop()