MCPcopy Index your code
hub / github.com/RustPython/RustPython / setUp

Method setUp

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

Source from the content-addressed store, hash-verified

3155class ExceptionNotesTest(unittest.TestCase):
3156
3157 def setUp(self):
3158 self.codec_name = 'exception_notes_test'
3159 codecs.register(_get_test_codec)
3160 self.addCleanup(codecs.unregister, _get_test_codec)
3161
3162 # We store the object to raise on the instance because of a bad
3163 # interaction between the codec caching (which means we can't
3164 # recreate the codec entry) and regrtest refleak hunting (which
3165 # runs the same test instance multiple times). This means we
3166 # need to ensure the codecs call back in to the instance to find
3167 # out which exception to raise rather than binding them in a
3168 # closure to an object that may change on the next run
3169 self.obj_to_raise = RuntimeError
3170
3171 def tearDown(self):
3172 _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