f"Empty locale identifier value: {identifier!r}\n\n"
f"If you didn't explicitly pass an empty value to a Babel function, "
f"this could be caused by there being no suitable locale environment "
- f"variables for the API you tried to use.",
+ f"variables for the API you tried to use."
)
if isinstance(identifier, str):
raise ValueError(msg) # `parse_locale` would raise a ValueError, so let's do that here
def test_locale_parse_empty():
- with pytest.raises(ValueError, match="Empty"):
+ with pytest.raises(ValueError, match="Empty") as ei:
Locale.parse("")
+ assert isinstance(ei.value.args[0], str)
with pytest.raises(TypeError, match="Empty"):
Locale.parse(None)
with pytest.raises(TypeError, match="Empty"):