Commit 27e7303 authored Feb 3, 2025 · 25 / 26 · Verified
1 parent b50a1d2 commit 27e7303 Copy full SHA for 27e7303
File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ def parse(
343
343
f"Empty locale identifier value: { identifier !r} \n \n "
344
344
f"If you didn't explicitly pass an empty value to a Babel function, "
345
345
f"this could be caused by there being no suitable locale environment "
346
- f"variables for the API you tried to use." ,
346
+ f"variables for the API you tried to use."
347
347
)
348
348
if isinstance (identifier , str ):
349
349
raise ValueError (msg ) # `parse_locale` would raise a ValueError, so let's do that here
Original file line number Diff line number Diff line change @@ -395,8 +395,9 @@ def test_language_alt_official_not_used():
395
395
396
396
397
397
def test_locale_parse_empty ():
398
- with pytest .raises (ValueError , match = "Empty" ):
398
+ with pytest .raises (ValueError , match = "Empty" ) as ei :
399
399
Locale .parse ("" )
400
+ assert isinstance (ei .value .args [0 ], str )
400
401
with pytest .raises (TypeError , match = "Empty" ):
401
402
Locale .parse (None )
402
403
with pytest .raises (TypeError , match = "Empty" ):
You can’t perform that action at this time.
0 commit comments