From 38e0c52a2b2d490cd5049bc317745da8c738651d Mon Sep 17 00:00:00 2001 From: Carolyn Nguyen Date: Fri, 15 Oct 2021 00:37:01 -0700 Subject: [PATCH] Use yaml.safe_load() instead of yaml.load() PyYAML deprecated use of yaml.load() function without Loader argument since 5.1. Updating to call safe_load() instead as load() was deemed unsafe per PyYAML documatation since its first release in 2006 --- tests/unit/test_workflow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_workflow.py b/tests/unit/test_workflow.py index b11398e..31b51fd 100644 --- a/tests/unit/test_workflow.py +++ b/tests/unit/test_workflow.py @@ -272,7 +272,7 @@ def test_list_workflows(client): def test_cloudformation_export_with_simple_definition(workflow): cfn_template = workflow.get_cloudformation_template() - cfn_template = yaml.load(cfn_template) + cfn_template = yaml.safe_load(cfn_template) assert 'StateMachineComponent' in cfn_template['Resources'] assert workflow.role == cfn_template['Resources']['StateMachineComponent']['Properties']['RoleArn'] assert cfn_template['Description'] == "CloudFormation template for AWS Step Functions - State Machine" @@ -300,7 +300,7 @@ def test_cloudformation_export_with_sagemaker_execution_role(workflow): } }) cfn_template = workflow.get_cloudformation_template(description="CloudFormation template with Sagemaker role") - cfn_template = yaml.load(cfn_template) + cfn_template = yaml.safe_load(cfn_template) assert json.dumps(workflow.definition.to_dict(), indent=2) == cfn_template['Resources']['StateMachineComponent']['Properties']['DefinitionString'] assert workflow.role == cfn_template['Resources']['StateMachineComponent']['Properties']['RoleArn'] assert cfn_template['Description'] == "CloudFormation template with Sagemaker role"