each teststeps in one testcase share the same session.

This commit is contained in:
debugtalk
2019-01-25 14:08:53 +08:00
parent c17875c82c
commit 824cfaf515
2 changed files with 4 additions and 4 deletions
+2
View File
@@ -169,6 +169,8 @@ class HttpSession(requests.Session):
:param cert: (optional) :param cert: (optional)
if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
""" """
self.init_meta_data()
# record test name # record test name
self.meta_data["name"] = name self.meta_data["name"] = name
+2 -4
View File
@@ -282,11 +282,9 @@ class Runner(object):
""" """
self.meta_datas = [] self.meta_datas = []
config = testcase_dict.get("config", {}) config = testcase_dict.get("config", {})
base_url = config.get("base_url")
# each testcase should have individual session. # each teststeps in one testcase (YAML/JSON) share the same session.
http_client_session = self.http_client_session.__class__(base_url) test_runner = Runner(config, self.functions, self.http_client_session)
test_runner = Runner(config, self.functions, http_client_session)
tests = testcase_dict.get("teststeps", []) tests = testcase_dict.get("teststeps", [])