]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-130655: gettext: Add fallback testcase (#136857)
authorDominic H. <dom@dominic.sk>
Sun, 20 Jul 2025 12:08:13 +0000 (14:08 +0200)
committerGitHub <noreply@github.com>
Sun, 20 Jul 2025 12:08:13 +0000 (14:08 +0200)
Lib/test/test_gettext.py

index 33b7d75e3ff203db0c8a37e725c46399050baa6c..9ad37909a8ec4e015b0c6e6c98400aa3d001be79 100644 (file)
@@ -937,6 +937,13 @@ class MiscTestCase(unittest.TestCase):
         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()