def _log_assert_failed(self, message, back_count=2): """记录断言失败的信息 """ stack = get_last_frame_stack(back_count) msg = "检查点不通过\n%s%s\n" % (smart_text(stack), smart_text(message)) self.__testresult.log_record(EnumLogLevel.ASSERT, msg) if not settings.get("QTAF_ASSERT_CONTINUE", True): raise RuntimeError("testcase assert failed:%s" % message)
def __record_assert_failed(self, message, actual, expect): '''记录Assert失败信息 :param message: 提示信息 :type message: string :param actual: 实际值 :type actual: string :param expect: 期望值 :type expect: string ''' #得到上一个函数调用帧所在的文件路径,行号,函数名 stack = get_last_frame_stack(3) msg = "检查点不通过\n%s%s\n期望值:%s%s\n实际值:%s%s" % ( stack, message, expect.__class__, expect, actual.__class__, actual) self.__testresult.log_record(EnumLogLevel.ASSERT, msg)
def __record_assert_failed(self, message, actual, expect): '''记录Assert失败信息 :param message: 提示信息 :type message: string :param actual: 实际值 :type actual: string :param expect: 期望值 :type expect: string ''' # 得到上一个函数调用帧所在的文件路径,行号,函数名 stack = get_last_frame_stack(3) msg = "检查点不通过\n%s%s\n期望值:%s%s\n实际值:%s%s" % ( smart_text(stack), smart_text(message), expect.__class__, expect, actual.__class__, actual) self.__testresult.log_record(EnumLogLevel.ASSERT, msg) if not settings.get("QTAF_ASSERT_CONTINUE", True): raise RuntimeError("testcase assert failed:%s" % message)
def _log_assert_failed(self, message, back_count=2): """记录断言失败的信息 """ stack = get_last_frame_stack(back_count) msg = "检查点不通过\n%s%s\n" % (stack, message) self.__testresult.log_record(EnumLogLevel.ASSERT, msg)