mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-31 13:29:35 +08:00
add hook feature:
1, setup_hook: call function before request 2, teardown_hook: call function after request
This commit is contained in:
@@ -65,7 +65,7 @@ class TestRunner(ApiServerUnittest):
|
||||
{"check": "status_code", "expect": 205},
|
||||
{"check": "content.token", "comparator": "len_eq", "expect": 19}
|
||||
],
|
||||
"teardown": ["${sleep(2)}"]
|
||||
"teardown_hooks": ["teardown_hook_sleep_1_secs"]
|
||||
}
|
||||
|
||||
with self.assertRaises(exception.ValidationError):
|
||||
|
||||
Reference in New Issue
Block a user