summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2016-11-28 18:02:34 +0100
committerAnthon van der Neut <anthon@mnt.org>2016-11-28 18:02:34 +0100
commit786fc2f80aa5c2d626674c7c9125c4c3be874af6 (patch)
treeeedc7a090bcecc52ce4925cc76af8f1090792c9f /_test
parent0ab4dd3ca904554aecc272d707ce1946a56a50d4 (diff)
downloadruamel.yaml-786fc2f80aa5c2d626674c7c9125c4c3be874af6.tar.gz
addresses #25 comment after empty (null) values0.13.2
can remove comment between key en value
Diffstat (limited to '_test')
-rw-r--r--_test/test_comments.py32
-rw-r--r--_test/test_numpy.py2
2 files changed, 33 insertions, 1 deletions
diff --git a/_test/test_comments.py b/_test/test_comments.py
index f2aa1f0..019d8b7 100644
--- a/_test/test_comments.py
+++ b/_test/test_comments.py
@@ -659,3 +659,35 @@ class TestUnicodeComments:
- :no: 05273867 # 〇
- :no: 05205786 # 〇𤦌
""")
+
+
+class TestEmptyValueBeforeComments:
+ @pytest.mark.xfail(strict=True)
+ def test_issue_25a(self):
+ round_trip("""\
+ - a: b
+ c: d
+ d: # foo
+ - e: f
+ """)
+
+ def test_issue_25b(self):
+ round_trip("""\
+ var1: #empty
+ var2: something #notempty
+ """)
+
+ def test_issue_25c(self):
+ round_trip("""\
+ params:
+ a: 1 # comment a
+ b: # comment b
+ c: 3 # comment c
+ """)
+
+ def test_issue_25_00(self):
+ round_trip("""\
+ params:
+ a: 1 # comment a
+ b: # comment b
+ """)
diff --git a/_test/test_numpy.py b/_test/test_numpy.py
index deec7a2..1a6eabb 100644
--- a/_test/test_numpy.py
+++ b/_test/test_numpy.py
@@ -10,7 +10,7 @@ except:
import ruamel.yaml
-def test_numpy():
+def Xtest_numpy():
if numpy is None:
return
data = numpy.arange(10)