Fix unittests for use with PyYAML 5.1#137
Conversation
According to the ChangeLog (https://pyyaml.org/wiki/PyYAML), PyYAML 5.1 changed the default for the `default_flow_style` argument of dumpers, which makes all related unittests fail.
| default_flow_style=False) | ||
| else: | ||
| content += yaml.safe_dump(items) | ||
| content += yaml.safe_dump(items, allow_unicode=True, |
There was a problem hiding this comment.
This seems to change the behavior of the function. Before the change, allow_unicode was not explicitly set to True if pretty mode is disabled.
There was a problem hiding this comment.
That's true. But I couldn't see a reason to disallow unicode when pretty is False. Is there one?
There was a problem hiding this comment.
I'm not sure in this case, but in general, I think it's good to not change something without understanding the implications or intent as this can lead to subtle bugs. One approach is to use git blame and track down the author to see if he or she remembers. That being said, I think this should be a separate PR if we do want to change it since it's a separate and perhaps unnecessary change.
|
Closing in favour of #133. |
According to the ChangeLog (https://pyyaml.org/wiki/PyYAML), PyYAML 5.1 changed
the default for the
default_flow_styleargument of dumpers, which makes all related unittests fail.This addresses #136.