Closed trallnag closed 3 years ago
Here is a pytest test:
def test_box_from_empty_yaml_error(tmp_path):
file_path = tmp_path / "file.yml"
file_path.write_text("---")
with pytest.raises(BoxError):
_ = settings_utils.parse_yamls([file_path.resolve()])
Ruamel YAML will return
None
if you load an empty file:echo "---" > empty.yml
So when I use the Box function
from_yaml()
with an empty dict it raises aBoxError
.It would be nice to return
{}
instead since I don't think an empty YAML file should lead to an error