MCPcopy Index your code
hub / github.com/python/cpython / setUpClass

Method setUpClass

Lib/test/test_gettext.py:176–195  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

174class GettextBaseTest(unittest.TestCase):
175 @classmethod
176 def setUpClass(cls):
177 cls.addClassCleanup(os_helper.rmtree, os.path.split(LOCALEDIR)[0])
178 if not os.path.isdir(LOCALEDIR):
179 os.makedirs(LOCALEDIR)
180 with open(MOFILE, 'wb') as fp:
181 fp.write(base64.decodebytes(GNU_MO_DATA))
182 with open(MOFILE_BAD_MAGIC_NUMBER, 'wb') as fp:
183 fp.write(base64.decodebytes(GNU_MO_DATA_BAD_MAGIC_NUMBER))
184 with open(MOFILE_BAD_MAJOR_VERSION, 'wb') as fp:
185 fp.write(base64.decodebytes(GNU_MO_DATA_BAD_MAJOR_VERSION))
186 with open(MOFILE_BAD_MINOR_VERSION, 'wb') as fp:
187 fp.write(base64.decodebytes(GNU_MO_DATA_BAD_MINOR_VERSION))
188 with open(MOFILE_CORRUPT, 'wb') as fp:
189 fp.write(base64.decodebytes(GNU_MO_DATA_CORRUPT))
190 with open(MOFILE_BIG_ENDIAN, 'wb') as fp:
191 fp.write(base64.decodebytes(GNU_MO_DATA_BIG_ENDIAN))
192 with open(UMOFILE, 'wb') as fp:
193 fp.write(base64.decodebytes(UMO_DATA))
194 with open(MMOFILE, 'wb') as fp:
195 fp.write(base64.decodebytes(MMO_DATA))
196
197 def setUp(self):
198 self.env = self.enterContext(os_helper.EnvironmentVarGuard())

Callers

nothing calls this directly

Calls 5

addClassCleanupMethod · 0.80
openFunction · 0.50
splitMethod · 0.45
isdirMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected