[3.14] gh-130655: gettext: Add fallback testcase (GH-136857) (#136862)

gh-130655: gettext: Add fallback testcase (GH-136857)
(cherry picked from commit c6e6fe92cd)

Co-authored-by: Dominic H <dom@dominic.sk>
This commit is contained in:
Miss Islington (bot) 2025-07-20 14:32:58 +02:00 committed by GitHub
parent ee37365e0d
commit c537b98e48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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()