From b870227ce3f20e0c1e56f713a693e5e2c8f12400 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 3 Jul 2020 19:52:40 +0800 Subject: [PATCH] fix: raise TestCaseFormatError if ref testcase is invalid --- httprunner/make.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/httprunner/make.py b/httprunner/make.py index ada16813..e1edb44c 100644 --- a/httprunner/make.py +++ b/httprunner/make.py @@ -367,6 +367,9 @@ def make_testcase(testcase: Dict, dir_path: Text = None) -> Text: ref_testcase_path = __ensure_absolute(teststep["testcase"]) test_content = load_test_file(ref_testcase_path) + if not isinstance(test_content, Dict): + raise exceptions.TestCaseFormatError(f"Invalid teststep: {teststep}") + # api in v2 format, convert to v3 testcase if "request" in test_content and "name" in test_content: test_content = ensure_testcase_v3_api(test_content)