diff --git a/ApiAutomationTest/app/cores/case/base/expectation.py b/ApiAutomationTest/app/cores/case/base/expectation.py index 4be260d..e6423da 100644 --- a/ApiAutomationTest/app/cores/case/base/expectation.py +++ b/ApiAutomationTest/app/cores/case/base/expectation.py @@ -31,8 +31,8 @@ def get_expectations_result(expectations, request, expectation_logic) -> bool: last_failure_msg = '[期望值: %s] [实际值: 请参考“响应-响应体”中内容]' % expectation.value_ # 解决HTTP响应文本内容包含html片段导致前台解析问题 end expectation.update_assert_result(last_result=last_result, last_failure_msg=last_failure_msg) - if len(rets) == 0: # 未设置期望断言则结果为False - return False + if len(rets) == 0: # 未设置期望断言则结果为True + return True if expectation_logic == EXPECTATION_LOGIC.AND: return all(rets) if expectation_logic == EXPECTATION_LOGIC.OR: