Skip to content

Commit

Permalink
Clear cache after setting environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-easterbrook committed Dec 27, 2023
1 parent 93db76a commit 14322b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ def test_localisation(self):
# change locale directory away and back to clear gettext cache
exiv2.types._set_locale_dir(os.path.dirname(locale_dir))
exiv2.types._set_locale_dir(locale_dir)
if exiv2.exvGettext(str_en) == str_en:
# setlocale is being ignored, try environment variable
os.environ['LANGUAGE'] = name
locale.setlocale(locale.LC_MESSAGES, '')
exiv2.types._set_locale_dir(os.path.dirname(locale_dir))
exiv2.types._set_locale_dir(locale_dir)
self.assertEqual(exiv2.exvGettext(str_en), str_de)
locale.setlocale(locale.LC_MESSAGES, old_locale)

Expand Down

0 comments on commit 14322b9

Please sign in to comment.