Skip to content

Commit ec46864

Browse files
committed
run: pass through stdin, just close then
1 parent c36a905 commit ec46864

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/_pytest/pytester.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,6 @@ def run(self, *cmdargs, **kwargs):
10961096
stdin = kwargs.pop("stdin", Testdir.CLOSE_STDIN)
10971097
raise_on_kwargs(kwargs)
10981098

1099-
popen_kwargs = {"stdin": stdin}
1100-
if isinstance(stdin, bytes):
1101-
popen_kwargs["stdin"] = subprocess.PIPE
1102-
11031099
cmdargs = [
11041100
str(arg) if isinstance(arg, py.path.local) else arg for arg in cmdargs
11051101
]
@@ -1113,13 +1109,12 @@ def run(self, *cmdargs, **kwargs):
11131109
now = time.time()
11141110
popen = self.popen(
11151111
cmdargs,
1112+
stdin=stdin,
11161113
stdout=f1,
11171114
stderr=f2,
11181115
close_fds=(sys.platform != "win32"),
1119-
**popen_kwargs
11201116
)
11211117
if isinstance(stdin, bytes):
1122-
popen.stdin.write(stdin)
11231118
popen.stdin.close()
11241119

11251120
def handle_timeout():

0 commit comments

Comments
 (0)