def handle_assert(test): try: test() except AssertionError: trace = get_trace_start(exc_info()[2])[0] lineno = trace[1] call = trace[3] raise PyInqAssertError(lineno,call)
def handle_assert(test): try: test() except AssertionError: trace = get_trace_start(exc_info()[2])[0] lineno = trace[1] call = trace[3] raise PyInqAssertError(lineno, call)
def handle_error(expected): exc_type,exc_value,trace_obj = exc_info()[:3] trace = get_trace_start(trace_obj) if expected and isinstance(exc_value,expected): lineno = trace[0][1] result = ExpectedErrorResult(True,expected,lineno) halt = False else: tb_str = create_tb_str(exc_type,exc_value,trace) result = UnexpectedError(tb_str) halt = True return result,halt
def handle_error(expected): exc_type, exc_value, trace_obj = exc_info()[:3] trace = get_trace_start(trace_obj) if expected and isinstance(exc_value, expected): lineno = trace[0][1] result = ExpectedErrorResult(True, expected, lineno) halt = False else: tb_str = create_tb_str(exc_type, exc_value, trace) result = UnexpectedError(tb_str) halt = True return result, halt