From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 20 Jul 2025 12:32:58 +0000 (+0200) Subject: [3.14] gh-130655: gettext: Add fallback testcase (GH-136857) (#136862) X-Git-Tag: v3.14.0rc1~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c537b98e489501e6ad33f244b9eb1e78db1e1bf2;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-130655: gettext: Add fallback testcase (GH-136857) (#136862) gh-130655: gettext: Add fallback testcase (GH-136857) (cherry picked from commit c6e6fe92cd8b90d546652764e3eaf1631da16f8f) Co-authored-by: Dominic H --- diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index 33b7d75e3ff2..9ad37909a8ec 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -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()