mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-130655: gettext: Add fallback testcase (#136857)
This commit is contained in:
parent
9c2f91cde8
commit
c6e6fe92cd
1 changed files with 7 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue