mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-13 00:11:28 +08:00
fix base_url priority: testcase config > testsuite config
This commit is contained in:
@@ -893,6 +893,9 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
|||||||
variables priority:
|
variables priority:
|
||||||
parameters > testsuite config > testcase config > testcase_def config > testcase_def tests > api
|
parameters > testsuite config > testcase config > testcase_def config > testcase_def tests > api
|
||||||
|
|
||||||
|
base_url priority:
|
||||||
|
testcase_def tests > testcase_def config > testcase config > testsuite config
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
testcases (dict):
|
testcases (dict):
|
||||||
{
|
{
|
||||||
@@ -927,6 +930,7 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
|||||||
}
|
}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
testsuite_base_url = testsuite_config.get("base_url")
|
||||||
testsuite_config_variables = testsuite_config.get("variables", {})
|
testsuite_config_variables = testsuite_config.get("variables", {})
|
||||||
functions = project_mapping.get("functions", {})
|
functions = project_mapping.get("functions", {})
|
||||||
parsed_testcase_list = []
|
parsed_testcase_list = []
|
||||||
@@ -938,6 +942,9 @@ def __get_parsed_testsuite_testcases(testcases, testsuite_config, project_mappin
|
|||||||
parsed_testcase["path"] = testcase["testcase"]
|
parsed_testcase["path"] = testcase["testcase"]
|
||||||
parsed_testcase["config"]["name"] = testcase_name
|
parsed_testcase["config"]["name"] = testcase_name
|
||||||
|
|
||||||
|
# base_url priority: testcase config > testsuite config
|
||||||
|
parsed_testcase["config"].setdefault("base_url", testsuite_base_url)
|
||||||
|
|
||||||
# 1, testsuite config => testcase config
|
# 1, testsuite config => testcase config
|
||||||
# override test_dict variables
|
# override test_dict variables
|
||||||
testcase_config_variables = utils.extend_variables(
|
testcase_config_variables = utils.extend_variables(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
variables:
|
variables:
|
||||||
uid: 9001
|
uid: 9001
|
||||||
device_sn: "TESTCASE_CREATE_XXX"
|
device_sn: "TESTCASE_CREATE_XXX"
|
||||||
base_url: "http://127.0.0.1:5000"
|
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: setup and reset all (override) for $device_sn.
|
name: setup and reset all (override) for $device_sn.
|
||||||
|
|||||||
Reference in New Issue
Block a user