fix #914: handle invalid test file

This commit is contained in:
debugtalk
2020-06-03 21:52:11 +08:00
parent 94fbab82ad
commit d1b7cdb14c

View File

@@ -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