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

Method test_rawio_write_through

Lib/test/test_io.py:3674–3682  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3672 self.assertEqual(list(txt), ['jkl\n', 'opq\n'])
3673
3674 def test_rawio_write_through(self):
3675 # Issue #12591: with write_through=True, writes don't need a flush
3676 raw = self.MockRawIO([b'abc', b'def', b'ghi\njkl\nopq\n'])
3677 txt = self.TextIOWrapper(raw, encoding='ascii', newline='\n',
3678 write_through=True)
3679 txt.write('1')
3680 txt.write('23\n4')
3681 txt.write('5')
3682 self.assertEqual(b''.join(raw._write_stack), b'123\n45')
3683
3684 def test_bufio_write_through(self):
3685 # 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