From 904b4403b17244b9533d45a92c23e5b789e3c673 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Sun, 21 Jul 2019 11:23:51 +0800 Subject: [PATCH] fi: dev: yaml load --- tests/test_bukuDb.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_bukuDb.py b/tests/test_bukuDb.py index f9b5bf5..5d18aef 100644 --- a/tests/test_bukuDb.py +++ b/tests/test_bukuDb.py @@ -1318,7 +1318,10 @@ def test_load_chrome_database(chrome_db, add_pt): dump_data = False # NOTE: change this value to dump data if not dump_data: with open(res_yaml_file, 'r') as f: - res_yaml = yaml.load(f, Loader=yaml.FullLoader) + try: + res_yaml = yaml.load(f, Loader=yaml.FullLoader) + except RuntimeError: + res_yaml = yaml.safe_load(f) # init import buku bdb = buku.BukuDb() @@ -1359,7 +1362,10 @@ def test_load_firefox_database(firefox_db, add_pt): res_yaml_file = firefox_db[1] if add_pt else firefox_db[2] if not dump_data: with open(res_yaml_file, 'r') as f: - res_yaml = yaml.load(f) + try: + res_yaml = yaml.load(f) + except RuntimeError: + res_yaml = yaml.safe_load(f) # init import buku bdb = buku.BukuDb()