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

Function test_popen_stdin_bytes

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

Source from the content-addressed store, hash-verified

673
674
675def test_popen_stdin_bytes(pytester: Pytester) -> None:
676 proc = pytester.popen(
677 [sys.executable, "-c", "import sys; print(sys.stdin.read())"],
678 stdout=subprocess.PIPE,
679 stderr=subprocess.PIPE,
680 stdin=b"input\n2ndline",
681 )
682 stdout, stderr = proc.communicate()
683 assert stdout.decode("utf8").splitlines() == ["input", "2ndline"]
684 assert stderr == b""
685 assert proc.returncode == 0
686
687
688def 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