From 48253e760d3770e06587b51ea89f1ca3b4b16ec5 Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sun, 7 Mar 2021 09:33:55 +0100 Subject: Skipping some tests on ruamel.yaml < 0.16 ruamel.yaml had some bugs in the round-trip loader which causes the format of entries to change when being rewritten; see the changelog entries for various 0.15 releases for details: https://pypi.org/project/ruamel.yaml/ --- tests/test_collection.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/test_collection.py b/tests/test_collection.py index c792f29..2218169 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -37,6 +37,10 @@ class testEntries(unittest.TestCase): self.assertEqual(entry.idterm, 'Q' + eid) self.assertEqual(entry.short_id, eid[:8]) + @unittest.skipIf( + ruamel.yaml.version_info < (0, 16, 0), + "Preservation of data on file requires ruamel.yaml >= 0.16", + ) def test_write_new(self): new_entry = lesana.Entry(self.collection) self.collection.save_entries(entries=[new_entry]) @@ -351,6 +355,10 @@ class testComplexCollection(unittest.TestCase): for f in to_test: self.assertIsInstance(self.collection.fields[f[0]], f[1]) + @unittest.skipIf( + ruamel.yaml.version_info < (0, 16, 0), + "Preservation of data on file requires ruamel.yaml >= 0.16", + ) def test_comments_are_preserved(self): e = self.collection.entry_from_eid('5084bc6e94f24dc6976629282ef30419') yaml_data = e.yaml_data @@ -361,6 +369,10 @@ class testComplexCollection(unittest.TestCase): yaml_data.endswith("# and a comment at the end\n") ) + @unittest.skipIf( + ruamel.yaml.version_info < (0, 16, 0), + "Preservation of data on file requires ruamel.yaml >= 0.16", + ) def test_data_is_stored_as_written_on_file(self): e = self.collection.entry_from_eid('5084bc6e94f24dc6976629282ef30419') fname = 'tests/data/complex/items/' + \ -- cgit v1.2.3