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

Method test_encoding_error_handler

Lib/test/test_bz2.py:1193–1199  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1191 self.assertEqual(f.read(), text)
1192
1193 def test_encoding_error_handler(self):
1194 # Test with non-default encoding error handler.
1195 with self.open(self.filename, "wb") as f:
1196 f.write(b"foo\xffbar")
1197 with self.open(self.filename, "rt", encoding="ascii", errors="ignore") \
1198 as f:
1199 self.assertEqual(f.read(), "foobar")
1200
1201 def test_newline(self):
1202 # Test with explicit newline (universal newline mode disabled).

Callers

nothing calls this directly

Calls 4

openMethod · 0.95
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected