bpo-40275: Use new test.support helper submodules in tests (GH-21412)

This commit is contained in:
Hai Shi 2020-07-09 21:25:10 +08:00 committed by GitHub
parent 61bb24a270
commit 96a6a6d42b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 154 additions and 134 deletions

View file

@ -5,6 +5,7 @@ import gettext
import unittest
from test import support
from test.support import os_helper
# TODO:
@ -129,14 +130,14 @@ class GettextBaseTest(unittest.TestCase):
fp.write(base64.decodebytes(UMO_DATA))
with open(MMOFILE, 'wb') as fp:
fp.write(base64.decodebytes(MMO_DATA))
self.env = support.EnvironmentVarGuard()
self.env = os_helper.EnvironmentVarGuard()
self.env['LANGUAGE'] = 'xx'
gettext._translations.clear()
def tearDown(self):
self.env.__exit__()
del self.env
support.rmtree(os.path.split(LOCALEDIR)[0])
os_helper.rmtree(os.path.split(LOCALEDIR)[0])
GNU_MO_DATA_ISSUE_17898 = b'''\
3hIElQAAAAABAAAAHAAAACQAAAAAAAAAAAAAAAAAAAAsAAAAggAAAC0AAAAAUGx1cmFsLUZvcm1z