]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-130655: gettext: Add fallback testcase (GH-136857) (#136863)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 20 Jul 2025 12:30:09 +0000 (14:30 +0200)
committerGitHub <noreply@github.com>
Sun, 20 Jul 2025 12:30:09 +0000 (12:30 +0000)
gh-130655: gettext: Add fallback testcase (GH-136857)
(cherry picked from commit c6e6fe92cd8b90d546652764e3eaf1631da16f8f)

Co-authored-by: Dominic H <dom@dominic.sk>
Lib/test/test_gettext.py

index 17299153295903635097cf7b4adbe90f73b87b2a..681de239d8cc28c3bce385ebbe0f29a6715da96a 100644 (file)
@@ -981,6 +981,13 @@ class MiscTestCase(unittest.TestCase):
                              not_exported={'c2py', 'ENOENT'})
 
 
+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()