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

Method test_line_buffering

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

Source from the content-addressed store, hash-verified

2955 self.assertIn(TestSubclass.__name__, repr(f))
2956
2957 def test_line_buffering(self):
2958 r = self.BytesIO()
2959 b = self.BufferedWriter(r, 1000)
2960 t = self.TextIOWrapper(b, encoding="utf-8", newline="\n", line_buffering=True)
2961 t.write("X")
2962 self.assertEqual(r.getvalue(), b"") # No flush happened
2963 t.write("Y\nZ")
2964 self.assertEqual(r.getvalue(), b"XY\nZ") # All got flushed
2965 t.write("A\rB")
2966 self.assertEqual(r.getvalue(), b"XY\nZA\rB")
2967
2968 def test_reconfigure_line_buffering(self):
2969 r = self.BytesIO()

Callers

nothing calls this directly

Calls 3

writeMethod · 0.95
getvalueMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected