PyYAML 5.1 breaks unit tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.serialization |
Fix Released
|
Critical
|
Ben Nemec |
Bug Description
PyYAML changed the default for default_flow_style in https:/
Because we weren't explicitly setting this value for our version of dumps, this broke our unit tests. We should explicitly set this since it's the expected behavior anyway. Also, we were already setting it in the dump function.
Unit test failure:
oslo_serializat
-------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
b'Traceback (most recent call last):'
b' File "/opt/stack/
b' self.assertEqua
b' File "/opt/stack/
b' self.assertThat
b' File "/opt/stack/
b' raise mismatch_error'
b'testtools
b"reference = '''\\"
b'- foo: bar'
b'- list: null'
b'- - one'
b' - two'
b'- check: yaml'
b' in: test'
b"'''"
b"actual = '''\\"
b'- {foo: bar}'
b'- {list: null}'
b'- [one, two]'
b'- {check: yaml, in: test}'
b"'''"
b''
b''
Fixed by https:/ /review. opendev. org/#/c/ 656813/