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

Method test_rawio_write_through

Lib/test/test_io/test_textio.py:1014–1022  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1012 self.assertEqual(list(txt), ['jkl\n', 'opq\n'])
1013
1014 def test_rawio_write_through(self):
1015 # Issue #12591: with write_through=True, writes don't need a flush
1016 raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n'])
1017 txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n',
1018 write_through=True)
1019 txt.write('1')
1020 txt.write('23\n4')
1021 txt.write('5')
1022 self.assertEqual(b''.join(raw._write_stack), b'123\n45')
1023
1024 def test_bufio_write_through(self):
1025 # Issue #21396: write_through=True doesn't force a flush()

Callers

nothing calls this directly

Calls 3

writeMethod · 0.95
assertEqualMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected