From d1b7cdb14c59dfa444f476b3bc0e204f317bdad2 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 3 Jun 2020 21:52:11 +0800 Subject: [PATCH] fix #914: handle invalid test file --- httprunner/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httprunner/loader.py b/httprunner/loader.py index aee39014..b90e2d5f 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -88,8 +88,8 @@ def load_testcase(testcase: Dict) -> TestCase: def load_testcase_file(testcase_file: Text) -> TestCase: """load testcase file and validate with pydantic model""" testcase_content = load_test_file(testcase_file) - testcase_content.setdefault("config", {})["path"] = testcase_file testcase_obj = load_testcase(testcase_content) + testcase_obj.config.path = testcase_file return testcase_obj