mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
change: validate testcase error message
This commit is contained in:
@@ -75,8 +75,8 @@ def load_testcase_file(testcase_file: Text) -> Tuple[Dict, TestCase]:
|
|||||||
# validate with pydantic TestCase model
|
# validate with pydantic TestCase model
|
||||||
testcase_obj = TestCase.parse_obj(testcase_content)
|
testcase_obj = TestCase.parse_obj(testcase_content)
|
||||||
except ValidationError as ex:
|
except ValidationError as ex:
|
||||||
err_msg = f"Invalid testcase format: {testcase_file}"
|
err_msg = f"TestCase ValidationError:\nfile: {testcase_file}\nerror: {ex}"
|
||||||
logger.error(f"{err_msg}\n{ex}")
|
logger.error(err_msg)
|
||||||
raise exceptions.TestCaseFormatError(err_msg)
|
raise exceptions.TestCaseFormatError(err_msg)
|
||||||
|
|
||||||
testcase_content["config"]["path"] = testcase_file
|
testcase_content["config"]["path"] = testcase_file
|
||||||
|
|||||||
Reference in New Issue
Block a user