jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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(-)

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:

To view, visit change 524640. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb3591c91554df2bf8d6f80519ee387d877fcde3
Gerrit-Change-Number: 524640
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)