Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5f73cf7

Browse files
test: Use yaml.safe_load() instead of yaml.load() in cloudformation export tests
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
1 parent 7f223e8 commit 5f73cf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎tests/unit/test_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_list_workflows(client):
272272

273273
def test_cloudformation_export_with_simple_definition(workflow):
274274
cfn_template = workflow.get_cloudformation_template()
275-
cfn_template = yaml.load(cfn_template)
275+
cfn_template = yaml.safe_load(cfn_template)
276276
assert 'StateMachineComponent' in cfn_template['Resources']
277277
assert workflow.role == cfn_template['Resources']['StateMachineComponent']['Properties']['RoleArn']
278278
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):
300300
}
301301
})
302302
cfn_template = workflow.get_cloudformation_template(description="CloudFormation template with Sagemaker role")
303-
cfn_template = yaml.load(cfn_template)
303+
cfn_template = yaml.safe_load(cfn_template)
304304
assert json.dumps(workflow.definition.to_dict(), indent=2) == cfn_template['Resources']['StateMachineComponent']['Properties']['DefinitionString']
305305
assert workflow.role == cfn_template['Resources']['StateMachineComponent']['Properties']['RoleArn']
306306
assert cfn_template['Description'] == "CloudFormation template with Sagemaker role"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /