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

Method test_unbuffered_input

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

Source from the content-addressed store, hash-verified

398 self.assertEqual(data, b'x', "text %s not unbuffered" % stream)
399
400 def test_unbuffered_input(self):
401 # sys.stdin still works with '-u'
402 code = ("import sys; sys.stdout.write(sys.stdin.read(1))")
403 p = spawn_python('-u', '-c', code)
404 p.stdin.write(b'x')
405 p.stdin.flush()
406 data, rc = _kill_python_and_exit_code(p)
407 self.assertEqual(rc, 0)
408 self.assertStartsWith(data, b'x')
409
410 def test_large_PYTHONPATH(self):
411 path1 = "ABCDE" * 100

Callers

nothing calls this directly

Calls 6

spawn_pythonFunction · 0.90
assertStartsWithMethod · 0.80
writeMethod · 0.45
flushMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected