@@ -81,8 +81,11 @@ def __from_yaml_dict__(cls, # type: Type[Y]
8181 f = Foo (1 , 'hello' ) # note:
8282
8383 # dump
84- y = f .dumps_yaml ()
85- assert y == "!yamlable/yaml.tests.Foo {a: 1, b: hello}\n "
84+ y = f .dumps_yaml (default_flow_style = False )
85+ assert y == """!yamlable/yaml.tests.Foo
86+ a: 1
87+ b: hello
88+ """
8689
8790 # dump io
8891 class MemorizingStringIO (StringIO ):
@@ -93,11 +96,11 @@ def close(self):
9396 StringIO .close (self )
9497
9598 s = MemorizingStringIO ()
96- f .dump_yaml (s )
99+ f .dump_yaml (s , default_flow_style = False )
97100 assert s .value == y
98101
99102 # dump pyyaml
100- assert dump (f ) == y
103+ assert dump (f , default_flow_style = False ) == y
101104
102105 # load
103106 assert f == Foo .loads_yaml (y )
@@ -147,8 +150,11 @@ def from_yaml_dict(cls, # type: Type[Y]
147150 f = FooLegacy (1 , 'hello' )
148151
149152 # dump
150- y = f .dumps_yaml ()
151- assert y == "!yamlable/yaml.tests.FooLegacy {a: 1, b: hello}\n "
153+ y = f .dumps_yaml (default_flow_style = False )
154+ assert y == """!yamlable/yaml.tests.FooLegacy
155+ a: 1
156+ b: hello
157+ """
152158
153159 # dump io
154160 class MemorizingStringIO (StringIO ):
@@ -159,11 +165,11 @@ def close(self):
159165 StringIO .close (self )
160166
161167 s = MemorizingStringIO ()
162- f .dump_yaml (s )
168+ f .dump_yaml (s , default_flow_style = False )
163169 assert s .value == y
164170
165171 # dump pyyaml
166- assert dump (f ) == y
172+ assert dump (f , default_flow_style = False ) == y
167173
168174 # load
169175 assert f == FooLegacy .loads_yaml (y )
@@ -228,10 +234,13 @@ def __init__(self, a, b):
228234 self .b = b
229235
230236 f = Foo_Default (1 , 'hello' )
231- s = '!yamlable/yaml.tests.Foo_Default {a: 1, b: hello}\n '
232- assert dump (f ) == s
237+ s = """!yamlable/yaml.tests.Foo_Default
238+ a: 1
239+ b: hello
240+ """
241+ assert dump (f , default_flow_style = False ) == s
233242
234- assert dump (load (dump (load (s )))) == s
243+ assert dump (load (dump (load (s ))), default_flow_style = False ) == s
235244
236245
237246def test_help_yaml_info ():
@@ -297,8 +306,11 @@ def __eq__(self, other):
297306 f = FooValid (1 , 'hello' ) # note:
298307
299308 # dump
300- y = f .dumps_yaml ()
301- assert y == "!yamlable/yaml.tests.FooValid {a: 1, b: hello}\n "
309+ y = f .dumps_yaml (default_flow_style = False )
310+ assert y == """!yamlable/yaml.tests.FooValid
311+ a: 1
312+ b: hello
313+ """
302314
303315 # dump io
304316 class MemorizingStringIO (StringIO ):
@@ -310,11 +322,11 @@ def close(self):
310322 StringIO .close (self )
311323
312324 s = MemorizingStringIO ()
313- f .dump_yaml (s )
325+ f .dump_yaml (s , default_flow_style = False )
314326 assert s .value == y
315327
316328 # dump pyyaml
317- assert dump (f ) == y
329+ assert dump (f , default_flow_style = False ) == y
318330
319331 # load
320332 assert f == FooValid .loads_yaml (y )
0 commit comments