diff options
author | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-03-07 09:33:55 +0100 |
---|---|---|
committer | Elena ``of Valhalla'' Grandi <valhalla@trueelena.org> | 2021-03-07 09:33:55 +0100 |
commit | 48253e760d3770e06587b51ea89f1ca3b4b16ec5 (patch) | |
tree | 20fa4aa8392bff9fa4243e83670501f08e03d4fd | |
parent | cfc138892d0f731162c3a93d83513447f89c0c56 (diff) |
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/
-rw-r--r-- | tests/test_collection.py | 12 |
1 files changed, 12 insertions, 0 deletions
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/' + \ |