jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/524640 )
Change subject: refactor(tests.utlis.execute): do not create an options dict ......................................................................
refactor(tests.utlis.execute): do not create an options dict
No need for that. It's easier to follow if the values are passed directly to Popen.
Change-Id: Ibb3591c91554df2bf8d6f80519ee387d877fcde3 --- M tests/utils.py 1 file changed, 4 insertions(+), 10 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py index 40f63bd..7fdaa1b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -11,7 +11,7 @@ import json import os import re -import subprocess +from subprocess import PIPE, Popen import sys import time import traceback @@ -672,16 +672,10 @@
# Set EDITOR to an executable that ignores all arguments and does nothing. env[str('EDITOR')] = str('call' if OSWIN32 else 'true') - - options = { - 'stdout': subprocess.PIPE, - 'stderr': subprocess.PIPE - } - if data_in is not None: - options['stdin'] = subprocess.PIPE - try: - p = subprocess.Popen(command, env=env, **options) + p = Popen( + command, env=env, stdout=PIPE, stderr=PIPE, + stdin=PIPE if data_in is not None else None) except TypeError as e: # Generate a more informative error if OSWIN32 and PY2: