Use yaml.safe_load instead of load (#6719)

Use of PyYAML's yaml.load function without specifying the Loader
parameter has been deprecated, see https://msg.pyyaml.org/load.

Earlier versions of PyYAML already had the alternative safe_load
function, which limits the loader to a subset of YAML constructs, that
is enough for what we need here.

Fixes #6677
This commit is contained in:
Rodolfo Carvalho 2019-05-29 17:51:24 +01:00 committed by Ryan P Kilby
parent 063f0de949
commit 62ed1f8270

View File

@ -45,7 +45,7 @@ class GenerateSchemaTests(TestCase):
'--description=Sample description',
stdout=self.out)
# Check valid YAML was output.
schema = yaml.load(self.out.getvalue())
schema = yaml.safe_load(self.out.getvalue())
assert schema['openapi'] == '3.0.2'
def test_renders_openapi_json_schema(self):