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

Method check_note

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

Source from the content-addressed store, hash-verified

3192 raise self.obj_to_raise
3193
3194 def check_note(self, obj_to_raise, msg, exc_type=RuntimeError):
3195 self.obj_to_raise = obj_to_raise
3196 self.set_codec(self.raise_obj, self.raise_obj)
3197 with self.assertNoted("encoding", exc_type, msg):
3198 "str_input".encode(self.codec_name)
3199 with self.assertNoted("encoding", exc_type, msg):
3200 codecs.encode("str_input", self.codec_name)
3201 with self.assertNoted("decoding", exc_type, msg):
3202 b"bytes input".decode(self.codec_name)
3203 with self.assertNoted("decoding", exc_type, msg):
3204 codecs.decode(b"bytes input", self.codec_name)
3205
3206 def test_raise_by_type(self):
3207 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