diff --git a/httprunner/runner.py b/httprunner/runner.py index 1742f249..e0e87410 100644 --- a/httprunner/runner.py +++ b/httprunner/runner.py @@ -14,16 +14,17 @@ class Runner(object): self.context = Context() config_dict = config_dict or {} - self.init_config(config_dict, "testset") # testset setup hooks testset_setup_hooks = config_dict.pop("setup_hooks", []) - if testset_setup_hooks: - self.do_hook_actions(testset_setup_hooks) - # testset teardown hooks self.testset_teardown_hooks = config_dict.pop("teardown_hooks", []) + self.init_config(config_dict, "testset") + + if testset_setup_hooks: + self.do_hook_actions(testset_setup_hooks) + def __del__(self): if self.testset_teardown_hooks: self.do_hook_actions(self.testset_teardown_hooks)