From: Daniel Axtens Date: Fri, 15 Mar 2019 06:27:40 +0000 (+1100) Subject: Fix YAML loader warning X-Git-Tag: v2.2.0-rc1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4698b2eddd3978aa0ee85e6740c5b4381fc4d76;p=thirdparty%2Fpatchwork.git Fix YAML loader warning In my tests I'm seeing: /home/patchwork/patchwork/patchwork/tests/api/validator.py:229: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. Fix this by using the safe loader in the tests. Signed-off-by: Daniel Axtens Reviewed-by: Stephen Finucane --- diff --git a/patchwork/tests/api/validator.py b/patchwork/tests/api/validator.py index 3f138479..ad4d7f15 100644 --- a/patchwork/tests/api/validator.py +++ b/patchwork/tests/api/validator.py @@ -226,7 +226,7 @@ def _load_spec(version): 'patchwork.yaml') with open(spec_path, 'r') as fh: - data = yaml.load(fh) + data = yaml.load(fh, Loader=yaml.SafeLoader) _LOADED_SPECS[version] = openapi_core.create_spec(data)