remove empty variables in saved tests

This commit is contained in:
debugtalk
2018-11-23 11:41:36 +08:00
parent 324c0b6f9f
commit 24e6b408e4

View File

@@ -153,8 +153,9 @@ class HttpRunner(object):
tests_mapping = path_or_testcases
elif validator.is_testcase_path(path_or_testcases):
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
if "variables" in tests_mapping["project_mapping"]:
tests_mapping["project_mapping"]["variables"] = mapping
else:
raise exceptions.ParamsError("invalid testcase path or testcases.")