From c716679edf348ba59d7551600c9cf139e23961ef Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Wed, 27 Feb 2019 22:57:46 +0100 Subject: fix issue #279 block sequence elements with flow mapping collapsed *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))* --- _test/test_issues.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to '_test') diff --git a/_test/test_issues.py b/_test/test_issues.py index d5913f6..4780da5 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -560,6 +560,26 @@ class TestIssues: """ d = round_trip(inp) # NOQA + # @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError) + def test_issue_279(self): + from ruamel.yaml import YAML + from ruamel.yaml.compat import StringIO + + yaml = YAML() + yaml.indent(sequence=4, offset=2) + inp = dedent("""\ + experiments: + - datasets: + # ATLAS EWK + - {dataset: ATLASWZRAP36PB, frac: 1.0} + - {dataset: ATLASZHIGHMASS49FB, frac: 1.0} + """) + a = yaml.load(inp) + buf = StringIO() + yaml.dump(a, buf) + print(buf.getvalue()) + assert buf.getvalue() == inp + def test_issue_280(self): from ruamel.yaml import YAML from ruamel.yaml.representer import RepresenterError @@ -576,6 +596,3 @@ class TestIssues: # inp = """ # """ # d = round_trip(inp) # NOQA - - - -- cgit v1.2.1