| 659 | |
| 660 | |
| 661 | def test_popen_stdin_pipe(pytester: Pytester) -> None: |
| 662 | proc = pytester.popen( |
| 663 | [sys.executable, "-c", "import sys; print(sys.stdin.read())"], |
| 664 | stdout=subprocess.PIPE, |
| 665 | stderr=subprocess.PIPE, |
| 666 | stdin=subprocess.PIPE, |
| 667 | ) |
| 668 | stdin = b"input\n2ndline" |
| 669 | stdout, stderr = proc.communicate(input=stdin) |
| 670 | assert stdout.decode("utf8").splitlines() == ["input", "2ndline"] |
| 671 | assert stderr == b"" |
| 672 | assert proc.returncode == 0 |
| 673 | |
| 674 | |
| 675 | def test_popen_stdin_bytes(pytester: Pytester) -> None: |