Commit d83d8b04 authored by zhanhuasheng's avatar zhanhuasheng

bugfix

parent a35caedb
...@@ -102,9 +102,11 @@ class ReqHandler: ...@@ -102,9 +102,11 @@ class ReqHandler:
else: else:
raise TypeError('用例格式有误') raise TypeError('用例格式有误')
except AssertionError: except AssertionError:
logger.error(f'{title}用例执行失败,失败原因:断言不通过\n期望值{expected}\n实际返回值{res.text}') logger.error(f'{title}用例执行失败,失败原因:断言不通过\n用例{case}\n期望值{expected}\n实际返回值{res.text}')
raise AssertionError raise AssertionError
except Exception as e: except Exception as e:
import traceback
print(traceback.print_exc())
logger.error(f'{title}用例执行失败,失败原因:{e}') logger.error(f'{title}用例执行失败,失败原因:{e}')
raise Exception raise Exception
......
...@@ -3,9 +3,6 @@ import os ...@@ -3,9 +3,6 @@ import os
from Utils import path_handler from Utils import path_handler
class yamlHandler: class yamlHandler:
def get_case(self,file_path): def get_case(self,file_path):
try: try:
while file_path[0] == '/' or file_path[0] == '\\': while file_path[0] == '/' or file_path[0] == '\\':
......
...@@ -146,4 +146,5 @@ api16: ...@@ -146,4 +146,5 @@ api16:
- eq: {"$.code": 0} - eq: {"$.code": 0}
- eq: {"$.data.articleList[?(@.id == '${article_id}')].articleEvaluateBad": "${article_evaluate_bad_add}"} - eq: {"$.data.articleList[?(@.id == '${article_id}')].articleEvaluateBad": "${article_evaluate_bad_add}"}
- eq: {"$.data.articleList[?(@.id == '${article_id}')].articleEvaluateGood": "${article_evaluate_good_add}"} - eq: {"$.data.articleList[?(@.id == '${article_id}')].articleEvaluateGood": "${article_evaluate_good_add}"}
- eq: {"$.data.articleList[?(@.id == '${article_id}')].views": "${article_view_count_add}"} - eq: {"$.data.articleList[?(@.id == '${article_id}')].views": "${article_view_count_add}"}
\ No newline at end of file
...@@ -131,3 +131,4 @@ def call_fixture(): ...@@ -131,3 +131,4 @@ def call_fixture():
loop.run_until_complete(close_ws()) #关闭服务 loop.run_until_complete(close_ws()) #关闭服务
loop.stop() loop.stop()
loop.close() loop.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment