Merge pull request #7029 from blueyed/fix-test_popen_default_stdin_stderr_and_stdin_None-upstream
Fix `test_popen_default_stdin_stderr_and_stdin_None` when run with `-s`
This commit is contained in:
commit
b4c46da278
|
@ -679,6 +679,13 @@ def test_popen_default_stdin_stderr_and_stdin_None(testdir) -> None:
|
||||||
# stdout, stderr default to pipes,
|
# stdout, stderr default to pipes,
|
||||||
# stdin can be None to not close the pipe, avoiding
|
# stdin can be None to not close the pipe, avoiding
|
||||||
# "ValueError: flush of closed file" with `communicate()`.
|
# "ValueError: flush of closed file" with `communicate()`.
|
||||||
|
#
|
||||||
|
# Wraps the test to make it not hang when run with "-s".
|
||||||
|
p1 = testdir.makepyfile(
|
||||||
|
'''
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def test_inner(testdir):
|
||||||
p1 = testdir.makepyfile(
|
p1 = testdir.makepyfile(
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
|
@ -692,6 +699,10 @@ def test_popen_default_stdin_stderr_and_stdin_None(testdir) -> None:
|
||||||
assert stdout.splitlines() == [b"", b"stdout"]
|
assert stdout.splitlines() == [b"", b"stdout"]
|
||||||
assert stderr.splitlines() == [b"stderr"]
|
assert stderr.splitlines() == [b"stderr"]
|
||||||
assert proc.returncode == 0
|
assert proc.returncode == 0
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
result = testdir.runpytest("-p", "pytester", str(p1))
|
||||||
|
assert result.ret == 0
|
||||||
|
|
||||||
|
|
||||||
def test_spawn_uses_tmphome(testdir) -> None:
|
def test_spawn_uses_tmphome(testdir) -> None:
|
||||||
|
|
Loading…
Reference in New Issue