diff --git a/Utils/req_handler.py b/Utils/req_handler.py index 1719023ce251b290995b0a45782f4f8cac30c1f5..595f7fdc4191621b8ffec566a5584b831c9f1c1a 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 aba4f3b4b65c7ccc46ee239bd521be1663cbc099..399b9ba3fd844969035a123a32af693f2a7d9fed 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 6849086c7e24c2bd0b443422a545c1b27c0e1a16..ca40a5dce14d62f1a676ec24be1e4f532ffd4516 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 df533d9e74a11e8337702f962a559a4bd1f88138..001fb04091b6589d4eff71ddef36fde2f8c19bba 100644 --- a/conftest.py +++ b/conftest.py @@ -131,3 +131,4 @@ def call_fixture(): loop.run_until_complete(close_ws()) #关闭服务 loop.stop() loop.close() +