From d83d8b046c8652e51f59dec6dac2437da62d2bc4 Mon Sep 17 00:00:00 2001 From: zhanhuasheng Date: Wed, 10 Apr 2024 12:10:19 +0800 Subject: [PATCH] bugfix --- Utils/req_handler.py | 4 +++- Utils/yaml_handler.py | 3 --- YamlCase/FAQ/article.yaml | 3 ++- conftest.py | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Utils/req_handler.py b/Utils/req_handler.py index 1719023..595f7fd 100644 --- a/Utils/req_handler.py +++ b/Utils/req_handler.py @@ -102,9 +102,11 @@ class ReqHandler: else: raise TypeError('用例格式有误') except AssertionError: - logger.error(f'{title}用例执行失败,失败原因:断言不通过\n期望值{expected}\n实际返回值{res.text}') + logger.error(f'{title}用例执行失败,失败原因:断言不通过\n用例{case}\n期望值{expected}\n实际返回值{res.text}') raise AssertionError except Exception as e: + import traceback + print(traceback.print_exc()) logger.error(f'{title}用例执行失败,失败原因:{e}') raise Exception diff --git a/Utils/yaml_handler.py b/Utils/yaml_handler.py index aba4f3b..399b9ba 100644 --- a/Utils/yaml_handler.py +++ b/Utils/yaml_handler.py @@ -3,9 +3,6 @@ import os from Utils import path_handler class yamlHandler: - - - def get_case(self,file_path): try: while file_path[0] == '/' or file_path[0] == '\\': diff --git a/YamlCase/FAQ/article.yaml b/YamlCase/FAQ/article.yaml index 6849086..ca40a5d 100644 --- a/YamlCase/FAQ/article.yaml +++ b/YamlCase/FAQ/article.yaml @@ -146,4 +146,5 @@ api16: - eq: {"$.code": 0} - 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}')].views": "${article_view_count_add}"} \ No newline at end of file + - eq: {"$.data.articleList[?(@.id == '${article_id}')].views": "${article_view_count_add}"} + diff --git a/conftest.py b/conftest.py index df533d9..001fb04 100644 --- a/conftest.py +++ b/conftest.py @@ -131,3 +131,4 @@ def call_fixture(): loop.run_until_complete(close_ws()) #关闭服务 loop.stop() loop.close() + -- GitLab