Skip to content

Commit c537b98

Browse files
[3.14] gh-130655: gettext: Add fallback testcase (GH-136857) (#136862)
gh-130655: gettext: Add fallback testcase (GH-136857) (cherry picked from commit c6e6fe9) Co-authored-by: Dominic H <[email protected]>
1 parent ee37365 commit c537b98

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_gettext.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,13 @@ def test_lazy_import(self):
937937
ensure_lazy_imports("gettext", {"re", "warnings", "locale"})
938938

939939

940+
class TranslationFallbackTestCase(unittest.TestCase):
941+
def test_translation_fallback(self):
942+
with os_helper.temp_cwd() as tempdir:
943+
t = gettext.translation('gettext', localedir=tempdir, fallback=True)
944+
self.assertIsInstance(t, gettext.NullTranslations)
945+
946+
940947
if __name__ == '__main__':
941948
unittest.main()
942949

0 commit comments

Comments
 (0)