https://github.com/python/cpython/commit/c6e6fe92cd8b90d546652764e3eaf1631da16f8f
commit: c6e6fe92cd8b90d546652764e3eaf1631da16f8f
branch: main
author: Dominic H. <[email protected]>
committer: tomasr8 <[email protected]>
date: 2025-07-20T14:08:13+02:00
summary:

gh-130655: gettext: Add fallback testcase (#136857)

files:
M Lib/test/test_gettext.py

diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index 33b7d75e3ff203..9ad37909a8ec4e 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -937,6 +937,13 @@ def test_lazy_import(self):
         ensure_lazy_imports("gettext", {"re", "warnings", "locale"})
 
 
+class TranslationFallbackTestCase(unittest.TestCase):
+    def test_translation_fallback(self):
+        with os_helper.temp_cwd() as tempdir:
+            t = gettext.translation('gettext', localedir=tempdir, 
fallback=True)
+            self.assertIsInstance(t, gettext.NullTranslations)
+
+
 if __name__ == '__main__':
     unittest.main()
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to