feat: step setup hook

This commit is contained in:
debugtalk
2020-06-07 18:06:42 +08:00
parent 2a81937bc8
commit d991708439
5 changed files with 41 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v3.0.9
# NOTE: Generated By HttpRunner v3.0.10
# FROM: examples/httpbin/hooks.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
@@ -11,6 +11,8 @@ class TestCaseHooks(HttpRunner):
Step(
RunRequest("headers")
.with_variables(**{"a": 123})
.setup_hook("${setup_hook_add_kwargs($request)}")
.setup_hook("${setup_hook_remove_kwargs($request)}")
.get("/headers")
.validate()
.assert_equal("status_code", 200)