From 90532f8c0acc532d75e8a7bb7fa8c12fb2a55562 Mon Sep 17 00:00:00 2001 From: t-bug Date: Thu, 5 Dec 2019 19:39:58 +0800 Subject: [PATCH] refactor refactor: rearrange the report, failed test cases will be displayed at the head of the report. --- httprunner/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/httprunner/api.py b/httprunner/api.py index 7eda3126..6d6a3b99 100644 --- a/httprunner/api.py +++ b/httprunner/api.py @@ -131,7 +131,10 @@ class HttpRunner(object): logger.log_info("Start to run testcase: {}".format(testcase_name)) result = self.unittest_runner.run(testcase) - tests_results.append((testcase, result)) + if result.wasSuccessful(): + tests_results.append((testcase, result)) + else: + tests_results.insert(0, (testcase, result)) return tests_results