Skip to content

Commit

Permalink
test: set stdin too for pseudo-tty tests
Browse files Browse the repository at this point in the history
Ref: #10037
Ref: #10146
PR-URL: #10149
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
addaleax authored and MylesBorins committed Jan 23, 2017
1 parent 69c2ea9 commit a5fdd6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,12 @@ def Execute(args, context, timeout=None, env={}, faketty=False):
if faketty:
import pty
(out_master, fd_out) = pty.openpty()
fd_err = fd_out
fd_in = fd_err = fd_out
pty_out = out_master
else:
(fd_out, outname) = tempfile.mkstemp()
(fd_err, errname) = tempfile.mkstemp()
fd_in = 0
pty_out = None

# Extend environment
Expand All @@ -698,6 +699,7 @@ def Execute(args, context, timeout=None, env={}, faketty=False):
context,
timeout,
args = args,
stdin = fd_in,
stdout = fd_out,
stderr = fd_err,
env = env_copy,
Expand Down

0 comments on commit a5fdd6a

Please sign in to comment.