| 644 | |
| 645 | |
| 646 | def test_popen_stdin_pipe(pytester: Pytester) -> None: |
| 647 | proc = pytester.popen( |
| 648 | [sys.executable, "-c", "import sys; print(sys.stdin.read())"], |
| 649 | stdout=subprocess.PIPE, |
| 650 | stderr=subprocess.PIPE, |
| 651 | stdin=subprocess.PIPE, |
| 652 | ) |
| 653 | stdin = b"input\n2ndline" |
| 654 | stdout, stderr = proc.communicate(input=stdin) |
| 655 | assert stdout.decode("utf8").splitlines() == ["input", "2ndline"] |
| 656 | assert stderr == b"" |
| 657 | assert proc.returncode == 0 |
| 658 | |
| 659 | |
| 660 | def test_popen_stdin_bytes(pytester: Pytester) -> None: |