From 5ff4a55ae6fb8a6f9d9d5d8ffeb2c5b8ffa51c85 Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Sun, 24 Nov 2019 11:43:12 -0800 Subject: Force default_flow_style for pyyaml safe_dump This is to keep behavior of pre-5.1 pyyaml. --- tests/test_tablib.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test_tablib.py b/tests/test_tablib.py index 87482e0..5754bb2 100755 --- a/tests/test_tablib.py +++ b/tests/test_tablib.py @@ -1092,6 +1092,17 @@ class YAMLTests(BaseTestCase): self.assertEqual(_yaml, data.yaml) + def test_yaml_export(self): + """YAML export""" + + expected = """\ +- {first_name: John, gpa: 90, last_name: Adams} +- {first_name: George, gpa: 67, last_name: Washington} +- {first_name: Thomas, gpa: 50, last_name: Jefferson} +""" + output = self.founders.yaml + self.assertEqual(output, expected) + class LatexTests(BaseTestCase): def test_latex_export(self): -- cgit v1.2.1