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

Method test_invalid_utf8

Lib/test/test_capi/test_unicode.py:1826–1829  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1824 self.assertEqual(writer.finish(), "Hello Python")
1825
1826 def test_invalid_utf8(self):
1827 writer = self.create_writer(0)
1828 with self.assertRaises(UnicodeDecodeError):
1829 writer.write_utf8(b"invalid=\xFF", -1)
1830
1831 def test_recover_utf8_error(self):
1832 # test recovering from PyUnicodeWriter_WriteUTF8() error

Callers

nothing calls this directly

Calls 2

create_writerMethod · 0.95
assertRaisesMethod · 0.45

Tested by

no test coverage detected