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

Method test_unbuffered_input

Lib/test/test_cmd_line.py:364–372  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

362 self.assertEqual(data, b'x', "text %s not unbuffered" % stream)
363
364 def test_unbuffered_input(self):
365 # sys.stdin still works with '-u'
366 code = ("import sys; sys.stdout.write(sys.stdin.read(1))")
367 p = spawn_python('-u', '-c', code)
368 p.stdin.write(b'x')
369 p.stdin.flush()
370 data, rc = _kill_python_and_exit_code(p)
371 self.assertEqual(rc, 0)
372 self.assertTrue(data.startswith(b'x'), data)
373
374 def test_large_PYTHONPATH(self):
375 path1 = "ABCDE" * 100

Callers

nothing calls this directly

Calls 7

spawn_pythonFunction · 0.90
assertTrueMethod · 0.80
writeMethod · 0.45
flushMethod · 0.45
assertEqualMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected