mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-20 15:19:36 +08:00
refactor: use loader.load_cases to validate test files
This commit is contained in:
@@ -22,7 +22,12 @@ def _load_yaml_file(yaml_file):
|
||||
""" load yaml file and check file content format
|
||||
"""
|
||||
with io.open(yaml_file, 'r', encoding='utf-8') as stream:
|
||||
yaml_content = yaml.load(stream)
|
||||
try:
|
||||
yaml_content = yaml.load(stream)
|
||||
except yaml.YAMLError as ex:
|
||||
logger.log_error(str(ex))
|
||||
raise exceptions.FileFormatError
|
||||
|
||||
check_testcase_format(yaml_file, yaml_content)
|
||||
return yaml_content
|
||||
|
||||
|
||||
Reference in New Issue
Block a user