aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_gettext.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_gettext.py')
-rw-r--r--Lib/test/test_gettext.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index 467652a41f0..1608d1b18e9 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -117,6 +117,7 @@ MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo')
class GettextBaseTest(unittest.TestCase):
def setUp(self):
+ self.addCleanup(os_helper.rmtree, os.path.split(LOCALEDIR)[0])
if not os.path.isdir(LOCALEDIR):
os.makedirs(LOCALEDIR)
with open(MOFILE, 'wb') as fp:
@@ -129,14 +130,10 @@ class GettextBaseTest(unittest.TestCase):
fp.write(base64.decodebytes(UMO_DATA))
with open(MMOFILE, 'wb') as fp:
fp.write(base64.decodebytes(MMO_DATA))
- self.env = os_helper.EnvironmentVarGuard()
+ self.env = self.enterContext(os_helper.EnvironmentVarGuard())
self.env['LANGUAGE'] = 'xx'
gettext._translations.clear()
- def tearDown(self):
- self.env.__exit__()
- del self.env
- os_helper.rmtree(os.path.split(LOCALEDIR)[0])
GNU_MO_DATA_ISSUE_17898 = b'''\
3hIElQAAAAABAAAAHAAAACQAAAAAAAAAAAAAAAAAAAAsAAAAggAAAC0AAAAAUGx1cmFsLUZvcm1z