MCPcopy
hub / github.com/pytest-dev/pytest / test_popen_stdin_bytes

Function test_popen_stdin_bytes

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

popenMethod · 0.45

Tested by

no test coverage detected