Changeset - 1e381664f477
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2019-10-08 14:47:27
brettcsmith@brettcsmith.org
tests: Use yaml.full_load when available.

Per <https://msg.pyyaml.org/load>;.
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
tests/test_importers.py
Show inline comments
...
 
@@ -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']
 

	
0 comments (0 inline, 0 general)