From cc8b9d6939fec729309ef6f0b00075af7417be12 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 20 Jul 2025 14:30:09 +0200 Subject: [PATCH] [3.13] gh-130655: gettext: Add fallback testcase (GH-136857) (#136863) gh-130655: gettext: Add fallback testcase (GH-136857) (cherry picked from commit c6e6fe92cd8b90d546652764e3eaf1631da16f8f) Co-authored-by: Dominic H --- Lib/test/test_gettext.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index 172991532959..681de239d8cc 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -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() -- 2.47.3