(self)
| 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 | |
| 2793 | class TestSorted(unittest.TestCase): |
| 2794 |
nothing calls this directly
no test coverage detected