From 4d34d12d7e4cb22f666c8b587d27824f7811bb05 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 5 Jun 2020 17:04:37 +0800 Subject: [PATCH] fix: check if valid testcase file path --- httprunner/make.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/httprunner/make.py b/httprunner/make.py index 914aad29..bf9cb390 100644 --- a/httprunner/make.py +++ b/httprunner/make.py @@ -107,9 +107,8 @@ def __ensure_testcase_module(path: Text) -> NoReturn: def convert_testcase_path(testcase_path: Text) -> Tuple[Text, Text]: """convert single YAML/JSON testcase path to python file""" - if os.path.isdir(testcase_path): - # folder does not need to convert - return testcase_path, "" + if not os.path.isfile(testcase_path): + raise exceptions.ParamsError(f"Invalid testcase file path: {testcase_path}") testcase_path = __ensure_file_name(testcase_path) raw_file_name, file_suffix = os.path.splitext(os.path.basename(testcase_path))