From 5d3dc6ad1c03e37da8157d5f7424cc7730ecf6cd Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sat, 24 Nov 2018 00:00:25 +0800 Subject: [PATCH] bugfix: test_variables_mapping should be initialized before each test --- httprunner/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httprunner/context.py b/httprunner/context.py index b7d42b03..66bb3af8 100644 --- a/httprunner/context.py +++ b/httprunner/context.py @@ -17,7 +17,6 @@ class SessionContext(object): def __init__(self, functions, variables=None): self.session_variables_mapping = utils.ensure_mapping_format(variables or {}) self.FUNCTIONS_MAPPING = functions - self.test_variables_mapping = {} self.init_test_variables() def init_test_variables(self, variables_mapping=None): @@ -34,6 +33,7 @@ class SessionContext(object): ] """ + self.test_variables_mapping = {} variables_mapping = variables_mapping or {} variables_mapping = utils.ensure_mapping_format(variables_mapping) for variable_name, variable_value in variables_mapping.items():