From 1e381664f477ee11ff4032a72351278a2fafb174 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Tue, 8 Oct 2019 10:47:27 -0400 Subject: [PATCH] tests: Use yaml.full_load when available. Per . --- tests/test_importers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_importers.py b/tests/test_importers.py index bb8757c..01d66e6 100644 --- a/tests/test_importers.py +++ b/tests/test_importers.py @@ -14,9 +14,14 @@ from import2ledger import importers, strparse from . import DATA_DIR +try: + load_yaml = yaml.full_load +except AttributeError: + load_yaml = yaml.load + class TestImporters: with pathlib.Path(DATA_DIR, 'imports.yml').open() as yaml_file: - test_data = yaml.load(yaml_file) + test_data = load_yaml(yaml_file) for test in test_data: test['source'] = DATA_DIR / test['source']