gh-130655: gettext: Add fallback testcase (#136857)

This commit is contained in:
Dominic H. 2025-07-20 14:08:13 +02:00 committed by GitHub
parent 9c2f91cde8
commit c6e6fe92cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -937,6 +937,13 @@ def test_lazy_import(self):
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()