(self, code, expected)
| 460 | self.assertIn(escaped, data) |
| 461 | |
| 462 | def check_input(self, code, expected): |
| 463 | with tempfile.NamedTemporaryFile("wb+") as stdin: |
| 464 | sep = os.linesep.encode('ASCII') |
| 465 | stdin.write(sep.join((b'abc', b'def'))) |
| 466 | stdin.flush() |
| 467 | stdin.seek(0) |
| 468 | with subprocess.Popen( |
| 469 | (sys.executable, "-c", code), |
| 470 | stdin=stdin, stdout=subprocess.PIPE) as proc: |
| 471 | stdout, stderr = proc.communicate() |
| 472 | self.assertEqual(stdout.rstrip(), expected) |
| 473 | |
| 474 | def test_stdin_readline(self): |
| 475 | # Issue #11272: check that sys.stdin.readline() replaces '\r\n' by '\n' |
no test coverage detected