MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_popen_stdin_pipe

Function test_popen_stdin_pipe

testing/test_pytester.py:661–672  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

659
660
661def 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
675def test_popen_stdin_bytes(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 1

popenMethod · 0.45

Tested by

no test coverage detected