From 873e420842040229a10f18af9a7cb0a0efa65530 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 8 Jun 2020 16:22:05 +0800 Subject: [PATCH] fix: incorrect summary success when testcase failed --- docs/CHANGELOG.md | 6 ++++++ httprunner/runner.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 46d791c1..a3137538 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 3.0.11 (2020-06-08) + +**Fixed** + +- fix: incorrect summary success when testcase failed + ## 3.0.10 (2020-06-07) **Added** diff --git a/httprunner/runner.py b/httprunner/runner.py index d71debd3..f2c06c25 100644 --- a/httprunner/runner.py +++ b/httprunner/runner.py @@ -40,7 +40,7 @@ class HttpRunner(object): config: Config teststeps: List[Step] - success: bool = True # indicate testcase execution result + success: bool = False # indicate testcase execution result __config: TConfig __teststeps: List[TStep] __project_meta: ProjectMeta = None @@ -217,7 +217,7 @@ class HttpRunner(object): finally: # save request & response meta data self.__session.data.validators = resp_obj.validation_results - self.success &= self.__session.data.success + self.success = self.__session.data.success # save step data step_data.success = self.__session.data.success step_data.data = self.__session.data @@ -266,7 +266,7 @@ class HttpRunner(object): step_data.data = case_result.get_step_datas() # list of step data step_data.export_vars = case_result.get_export_variables() step_data.success = case_result.success - self.success &= case_result.success + self.success = case_result.success if step_data.export_vars: logger.info(f"export variables: {step_data.export_vars}")