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

Method test_input_no_stdout_fileno

Lib/test/test_builtin.py:2778–2791  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2776 "range(128)")
2777
2778 def test_input_no_stdout_fileno(self):
2779 # Issue #24402: If stdin is the original terminal but stdout.fileno()
2780 # fails, do not use the original stdout file descriptor
2781 def child(wpipe):
2782 print("stdin.isatty():", sys.stdin.isatty(), file=wpipe)
2783 sys.stdout = io.StringIO() # Does not support fileno()
2784 input("prompt")
2785 print("captured:", ascii(sys.stdout.getvalue()), file=wpipe)
2786 lines = self.run_child(child, b"quux\r")
2787 expected = (
2788 "stdin.isatty(): True",
2789 "captured: 'prompt'",
2790 )
2791 self.assertSequenceEqual(lines, expected)
2792
2793class TestSorted(unittest.TestCase):
2794

Callers

nothing calls this directly

Calls 2

run_childMethod · 0.95
assertSequenceEqualMethod · 0.80

Tested by

no test coverage detected