From 62ed1f82707916a23b4e97aae8e48f09ddaf1dea Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Wed, 29 May 2019 17:51:24 +0100 Subject: [PATCH] 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 --- tests/schemas/test_managementcommand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/schemas/test_managementcommand.py b/tests/schemas/test_managementcommand.py index e5960f2b0..42e0e99d1 100644 --- a/tests/schemas/test_managementcommand.py +++ b/tests/schemas/test_managementcommand.py @@ -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):