mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-03 06:49:38 +08:00
fix #363: clear meta data first to ensure independence for each test
This commit is contained in:
@@ -47,13 +47,15 @@ class HttpRunner(object):
|
||||
except exceptions.MyBaseFailure as ex:
|
||||
self.fail(str(ex))
|
||||
finally:
|
||||
if hasattr(test_runner.http_client_session, "meta_data"):
|
||||
self.meta_data = test_runner.http_client_session.meta_data
|
||||
self.meta_data["validators"] = test_runner.evaluated_validators
|
||||
test_runner.http_client_session.init_meta_data()
|
||||
self.meta_data = test_runner.get_test_data()
|
||||
|
||||
if "config" in test_dict:
|
||||
# run nested testcase
|
||||
test.__doc__ = test_dict["config"].get("name")
|
||||
else:
|
||||
# run api test
|
||||
test.__doc__ = test_dict.get("name")
|
||||
|
||||
# TODO: refactor
|
||||
test.__doc__ = test_dict.get("name") or test_dict.get("config", {}).get("name")
|
||||
return test
|
||||
|
||||
test_suite = unittest.TestSuite()
|
||||
|
||||
Reference in New Issue
Block a user