From 107d1231f213b1d1911ed5b617e87cf0923aa609 Mon Sep 17 00:00:00 2001 From: jack89roberts Date: Sun, 23 Jan 2022 17:57:38 +0000 Subject: [PATCH] PyYaml > 6 requires loader argument Replace with safe_load / safe_dump as used earlier in the material https://github.com/yaml/pyyaml/issues/576 --- record_fixture.py | 2 +- test_boids.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/record_fixture.py b/record_fixture.py index fd9c55a..e68d468 100644 --- a/record_fixture.py +++ b/record_fixture.py @@ -6,5 +6,5 @@ after=boids.boids fixture={"before":before,"after":after} fixture_file=open("fixture.yml",'w') -fixture_file.write(yaml.dump(fixture)) +fixture_file.write(yaml.safe_dump(fixture)) fixture_file.close() diff --git a/test_boids.py b/test_boids.py index 9d49739..11f0ba9 100644 --- a/test_boids.py +++ b/test_boids.py @@ -4,7 +4,7 @@ import yaml def test_bad_boids_regression(): - regression_data=yaml.load(open(os.path.join(os.path.dirname(__file__),'fixture.yml'))) + regression_data=yaml.safe_load(open(os.path.join(os.path.dirname(__file__),'fixture.yml'))) boid_data=regression_data["before"] update_boids(boid_data) for after,before in zip(regression_data["after"],boid_data):