From 3ccf68061ecc3e64e6afba9190cfc7ddab142bb5 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 1 Jan 2020 22:17:49 +0800 Subject: [PATCH] feat: check if testfile path, should be json or yaml file --- httprunner/loader/check.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/httprunner/loader/check.py b/httprunner/loader/check.py index 2f7720f4..5c0ca459 100644 --- a/httprunner/loader/check.py +++ b/httprunner/loader/check.py @@ -197,4 +197,8 @@ def is_testcase_path(path): if not os.path.exists(path): return False + file_suffix = os.path.splitext(path)[1].lower() + if file_suffix != ['.json', '.yaml', '.yml']: + return False + return True