summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
Diffstat (limited to '_test')
-rw-r--r--_test/test_issues.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 6392ebd..dd534ca 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -648,6 +648,22 @@ class TestIssues:
assert not a[1]
assert not a[3]
+ def test_issue_286(self):
+ from ruamel.yaml import YAML
+ from ruamel.yaml.compat import StringIO
+
+ yaml = YAML()
+ inp = dedent("""\
+ parent_key:
+ - sub_key: sub_value
+
+ # xxx""")
+ a = yaml.load(inp)
+ a['new_key'] = 'new_value'
+ buf = StringIO()
+ yaml.dump(a, buf)
+ assert buf.getvalue().endswith('xxx\nnew_key: new_value\n')
+
# @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
# def test_issue_ xxx(self):
# inp = """