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

Method test_captured_stdin

Lib/test/test_support.py:393–399  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

391 self.assertEqual(stderr.getvalue(), "hello\n")
392
393 def test_captured_stdin(self):
394 with support.captured_stdin() as stdin:
395 stdin.write('hello\n')
396 stdin.seek(0)
397 # call test code that consumes from sys.stdin
398 captured = input()
399 self.assertEqual(captured, "hello")
400
401 def test_gc_collect(self):
402 support.gc_collect()

Callers

nothing calls this directly

Calls 4

inputFunction · 0.85
writeMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected