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

Method setUp

Lib/test/test_codecs.py:3146–3158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3144class ExceptionNotesTest(unittest.TestCase):
3145
3146 def setUp(self):
3147 self.codec_name = 'exception_notes_test'
3148 codecs.register(_get_test_codec)
3149 self.addCleanup(codecs.unregister, _get_test_codec)
3150
3151 # We store the object to raise on the instance because of a bad
3152 # interaction between the codec caching (which means we can't
3153 # recreate the codec entry) and regrtest refleak hunting (which
3154 # runs the same test instance multiple times). This means we
3155 # need to ensure the codecs call back in to the instance to find
3156 # out which exception to raise rather than binding them in a
3157 # closure to an object that may change on the next run
3158 self.obj_to_raise = RuntimeError
3159
3160 def tearDown(self):
3161 _TEST_CODECS.pop(self.codec_name, None)

Callers

nothing calls this directly

Calls 2

addCleanupMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected