mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-19 04:34:06 +08:00
feat: make testcase with weight
This commit is contained in:
@@ -184,6 +184,9 @@ def make_config_chain_style(config: Dict) -> Text:
|
||||
if "export" in config:
|
||||
config_chain_style += f'.export(*{config["export"]})'
|
||||
|
||||
if "weight" in config:
|
||||
config_chain_style += f'.locust_weight({config["weight"]})'
|
||||
|
||||
return config_chain_style
|
||||
|
||||
|
||||
@@ -442,6 +445,10 @@ def make_testsuite(testsuite: Dict) -> NoReturn:
|
||||
)
|
||||
testcase_dict["config"]["variables"].update(testcase_variables)
|
||||
|
||||
# override weight
|
||||
weight = testcase.get("weight", 1)
|
||||
testcase_dict["config"]["weight"] = weight
|
||||
|
||||
# make testcase
|
||||
testcase_pytest_path = make_testcase(testcase_dict, testsuite_dir)
|
||||
pytest_files_run_set.add(testcase_pytest_path)
|
||||
|
||||
Reference in New Issue
Block a user