refactor context:

1, testset and testcase are in different context level;
2, testset context will be initialized when a file is loaded, and testcase level context initializes when each testcase starts;
3, testcase context should inherit from testset context configs, and the testcase context has high priority.
This commit is contained in:
httprunner
2017-07-01 21:40:46 +08:00
parent 1dbd86efeb
commit 5dc5ca950d
6 changed files with 164 additions and 117 deletions

View File

@@ -1,21 +1,15 @@
-
register_variables:
variable_binds:
- TOKEN: "debugtalk"
-
variable_binds:
- var: [1, 2, 3]
-
variable_binds:
- data: {'name': 'user', 'password': '123456'}
-
register_template_variables:
variable_binds:
- TOKEN: "debugtalk"
- token: ${TOKEN}
-
bind_lambda_functions:
function_binds:
add_one: "lambda x: x + 1"
add_two_nums: "lambda x, y: x + y"
@@ -23,7 +17,7 @@
- add1: {"func": "add_one", "args": [2]}
- sum2nums: {"func": "add_two_nums", "args": [2, 3]}
-
bind_lambda_functions_with_import:
requires:
- random
- string