Skip to content

Commit 61cd9a1

Browse files
committed
Allow setting environment for readline tests
This enable testing custom readline configuration using the INPUTRC environment variable, or passing arguments to the child process in a clean way.
1 parent 13e96cc commit 61cd9a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_readline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ def display(substitution, matches, longest_match_length):
211211
self.assertIn(b"history " + expected + b"\r\n", output)
212212

213213

214-
def run_pty(script, input=b"dummy input\r"):
214+
def run_pty(script, input=b"dummy input\r", env=None):
215215
pty = import_module('pty')
216216
output = bytearray()
217217
[master, slave] = pty.openpty()
218218
args = (sys.executable, '-c', script)
219-
proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave)
219+
proc = subprocess.Popen(args, stdin=slave, stdout=slave, stderr=slave, env=env)
220220
os.close(slave)
221221
with ExitStack() as cleanup:
222222
cleanup.enter_context(proc)

0 commit comments

Comments
 (0)