mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
remove empty variables in saved tests
This commit is contained in:
@@ -153,8 +153,9 @@ class HttpRunner(object):
|
|||||||
tests_mapping = path_or_testcases
|
tests_mapping = path_or_testcases
|
||||||
elif validator.is_testcase_path(path_or_testcases):
|
elif validator.is_testcase_path(path_or_testcases):
|
||||||
tests_mapping = loader.load_tests(path_or_testcases, dot_env_path)
|
tests_mapping = loader.load_tests(path_or_testcases, dot_env_path)
|
||||||
tests_mapping["project_mapping"]["variables"] = mapping or {}
|
|
||||||
tests_mapping["project_mapping"]["test_path"] = path_or_testcases
|
tests_mapping["project_mapping"]["test_path"] = path_or_testcases
|
||||||
|
if "variables" in tests_mapping["project_mapping"]:
|
||||||
|
tests_mapping["project_mapping"]["variables"] = mapping
|
||||||
else:
|
else:
|
||||||
raise exceptions.ParamsError("invalid testcase path or testcases.")
|
raise exceptions.ParamsError("invalid testcase path or testcases.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user