From 5a8af565d8f5016d68166fb8197ce9bca4717e77 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sun, 17 May 2020 09:53:54 +0800 Subject: [PATCH] fix: compatibility with file name includes dots and space --- httprunner/ext/make/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httprunner/ext/make/__init__.py b/httprunner/ext/make/__init__.py index bebbc762..3fc6ca4a 100644 --- a/httprunner/ext/make/__init__.py +++ b/httprunner/ext/make/__init__.py @@ -39,7 +39,7 @@ def make_testcase(testcase_path: str) -> Union[str, None]: raw_file_name, _ = os.path.splitext(os.path.basename(testcase_path)) # convert title case, e.g. request_with_variables => RequestWithVariables - name_in_title_case = raw_file_name.title().replace("_", "") + name_in_title_case = raw_file_name.replace(".", " ").title().replace("_", "").replace(" ", "") testcase_dir = os.path.dirname(testcase_path) testcase_python_path = os.path.join(testcase_dir, f"{raw_file_name}_test.py")