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

Method check_note

Lib/test/test_codecs.py:3183–3193  ·  view source on GitHub ↗
(self, obj_to_raise, msg, exc_type=RuntimeError)

Source from the content-addressed store, hash-verified

3181 raise self.obj_to_raise
3182
3183 def check_note(self, obj_to_raise, msg, exc_type=RuntimeError):
3184 self.obj_to_raise = obj_to_raise
3185 self.set_codec(self.raise_obj, self.raise_obj)
3186 with self.assertNoted("encoding", exc_type, msg):
3187 "str_input".encode(self.codec_name)
3188 with self.assertNoted("encoding", exc_type, msg):
3189 codecs.encode("str_input", self.codec_name)
3190 with self.assertNoted("decoding", exc_type, msg):
3191 b"bytes input".decode(self.codec_name)
3192 with self.assertNoted("decoding", exc_type, msg):
3193 codecs.decode(b"bytes input", self.codec_name)
3194
3195 def test_raise_by_type(self):
3196 self.check_note(RuntimeError, "")

Calls 4

set_codecMethod · 0.95
assertNotedMethod · 0.95
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected