From 01740004840ee4fa8c87e9710d2898167a5f5937 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Tue, 25 Jun 2019 20:56:09 +0800 Subject: [PATCH] fix: YAMLLoadWarning by specify yaml loader --- CHANGELOG.md | 1 + httprunner/loader.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6aa377..36611042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - fix extend with testcase reference in format version 2 - fix ImportError when locustio is not installed +- fix YAMLLoadWarning by specify yaml loader ## 2.2.0 (2019-06-24) diff --git a/httprunner/loader.py b/httprunner/loader.py index 8f1aadb7..bd346d42 100644 --- a/httprunner/loader.py +++ b/httprunner/loader.py @@ -35,7 +35,7 @@ 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) + yaml_content = yaml.load(stream, Loader=yaml.FullLoader) _check_format(yaml_file, yaml_content) return yaml_content