diff --git a/httprunner/__about__.py b/httprunner/__about__.py index 9e3940f9..7da6f942 100644 --- a/httprunner/__about__.py +++ b/httprunner/__about__.py @@ -1,7 +1,7 @@ __title__ = 'HttpRunner' __description__ = 'HTTP test runner, not just about api test and load test.' __url__ = 'https://github.com/HttpRunner/HttpRunner' -__version__ = '0.9.6' +__version__ = '0.9.6a1' __author__ = 'debugtalk' __author_email__ = 'mail@debugtalk.com' __license__ = 'MIT' diff --git a/httprunner/runner.py b/httprunner/runner.py index c2f6f126..7ab58cae 100644 --- a/httprunner/runner.py +++ b/httprunner/runner.py @@ -173,8 +173,6 @@ class Runner(object): finally: setup_teardown(teardown_actions) - return getattr(self.http_client_session, "meta_data", {}) - def extract_output(self, output_variables_list): """ extract output variables """ diff --git a/httprunner/task.py b/httprunner/task.py index f4ccc357..0a795fa9 100644 --- a/httprunner/task.py +++ b/httprunner/task.py @@ -12,12 +12,14 @@ class TestCase(unittest.TestCase): super(TestCase, self).__init__() self.test_runner = test_runner self.testcase_dict = testcase_dict - self.meta_data = {} def runTest(self): """ run testcase and check result. """ - self.meta_data = self.test_runner.run_test(self.testcase_dict) + try: + self.test_runner.run_test(self.testcase_dict) + finally: + self.meta_data = getattr(self.test_runner.http_client_session, "meta_data", {}) class TestSuite(unittest.TestSuite): """ create test suite with a testset, it may include one or several testcases. diff --git a/httprunner/templates/default_report_template.html b/httprunner/templates/default_report_template.html index f087314f..a71c1d67 100644 --- a/httprunner/templates/default_report_template.html +++ b/httprunner/templates/default_report_template.html @@ -177,8 +177,8 @@