Skip to content

Commit 849fae9

Browse files
Test all variables
1 parent a22b688 commit 849fae9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Lib/test/test_gettext.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,15 @@ def create_mo_file(self, lang):
737737
return mo_file
738738

739739
def test_find_with_env_vars(self):
740-
# test that find correctly finds the environment variable LANGUAGE
740+
# test that find correctly finds the environment variables
741741
# when languages are not supplied
742-
self.env.set('LANGUAGE', 'ga_IE')
743742
mo_file = self.create_mo_file("ga_IE")
744-
745-
result = gettext.find("mofile",
746-
localedir=os.path.join(self.tempdir, "locale"))
747-
self.assertEqual(result, mo_file)
743+
for var in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'):
744+
self.env.set(var, 'ga_IE')
745+
result = gettext.find("mofile",
746+
localedir=os.path.join(self.tempdir, "locale"))
747+
self.assertEqual(result, mo_file)
748+
self.env.unset(var)
748749

749750
def test_find_with_lanuages(self):
750751
# test that passed languages are used

0 commit comments

Comments
 (0)