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

Method test_read_text

Lib/test/test_pathlib/test_read.py:68–74  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 self.assertEqual(p.read_bytes(), b'this is file A\n')
67
68 def test_read_text(self):
69 p = self.root / 'fileA'
70 self.assertEqual(p.read_text(encoding='utf-8'), 'this is file A\n')
71 q = self.root / 'abc'
72 self.ground.create_file(q, b'\xe4bcdefg')
73 self.assertEqual(q.read_text(encoding='latin-1'), 'äbcdefg')
74 self.assertEqual(q.read_text(encoding='utf-8', errors='ignore'), 'bcdefg')
75
76 @unittest.skipIf(
77 not getattr(sys.flags, 'warn_default_encoding', 0),

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
read_textMethod · 0.45
create_fileMethod · 0.45

Tested by

no test coverage detected