From d1db909dfb9082c0e6de59748663689eb39c0032 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 5 Jun 2020 17:09:16 +0800 Subject: [PATCH] fix: make sure generated pytest folder exists --- httprunner/make.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httprunner/make.py b/httprunner/make.py index bf9cb390..f11a22d0 100644 --- a/httprunner/make.py +++ b/httprunner/make.py @@ -325,6 +325,9 @@ def make_testcase(testcase: Dict, dir_path: Text = None) -> Text: } content = __TEMPLATE__.render(data) + testcase_python_dir = os.path.dirname(testcase_python_path) + if not os.path.exists(testcase_python_dir): + os.makedirs(testcase_python_dir) with open(testcase_python_path, "w", encoding="utf-8") as f: f.write(content)