filter if files do not include testcases

This commit is contained in:
debugtalk
2017-08-30 12:18:32 +08:00
parent 8e9e9d6c57
commit bf117b671c
2 changed files with 3 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ def load_testcases_by_path(path):
path = os.path.join(os.getcwd(), path)
if os.path.isdir(path):
files_list = load_foler_files(path, ["*.yml", "*.json"])
files_list = load_foler_files(path, ["*.yml", "*.yaml", "*.json"])
return load_testcases_by_path(files_list)
elif os.path.isfile(path):
@@ -115,7 +115,7 @@ def load_testcases_by_path(path):
elif key == "test":
testset["testcases"].append(item["test"])
return [testset]
return [testset] if testset["testcases"] else []
else:
return []