diff --git a/tests/test_types.py b/tests/test_types.py index c09d0a88..4b0828d1 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -16,6 +16,7 @@ ## along with this program. If not, see ## . +import importlib import locale import os import random @@ -113,7 +114,6 @@ def test_localisation(self): str_en = 'Failed to read input data' str_de = 'Die Eingabedaten konnten nicht gelesen werden.' old_locale = locale.setlocale(locale.LC_MESSAGES, None) - locale_dir = locale.bindtextdomain('exiv2', None) # clear current locale locale.setlocale(locale.LC_MESSAGES, 'C') self.assertEqual(exiv2.exvGettext(str_en), str_en) @@ -133,8 +133,8 @@ def test_localisation(self): return if locale.getlocale() == (None, None): self.skipTest("set locale had no effect") - # call bindtextdomain to clear cache - locale.bindtextdomain('exiv2', locale_dir) + # reimport exiv2 to clear cache + exiv2 = importlib.reload(exiv2) self.assertEqual(exiv2.exvGettext(str_en), str_de) locale.setlocale(locale.LC_MESSAGES, old_locale)