aboutsummaryrefslogtreecommitdiff
path: root/python/run-tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/run-tests.py')
-rwxr-xr-xpython/run-tests.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/python/run-tests.py b/python/run-tests.py
index 152f5cc98d..f5857f8c62 100755
--- a/python/run-tests.py
+++ b/python/run-tests.py
@@ -31,23 +31,6 @@ if sys.version < '3':
import Queue
else:
import queue as Queue
-if sys.version_info >= (2, 7):
- subprocess_check_output = subprocess.check_output
-else:
- # SPARK-8763
- # backported from subprocess module in Python 2.7
- def subprocess_check_output(*popenargs, **kwargs):
- if 'stdout' in kwargs:
- raise ValueError('stdout argument not allowed, it will be overridden.')
- process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
- output, unused_err = process.communicate()
- retcode = process.poll()
- if retcode:
- cmd = kwargs.get("args")
- if cmd is None:
- cmd = popenargs[0]
- raise subprocess.CalledProcessError(retcode, cmd, output=output)
- return output
# Append `SPARK_HOME/dev` to the Python path so that we can import the sparktestsupport module
@@ -55,7 +38,7 @@ sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../de
from sparktestsupport import SPARK_HOME # noqa (suppress pep8 warnings)
-from sparktestsupport.shellutils import which # noqa
+from sparktestsupport.shellutils import which, subprocess_check_output # noqa
from sparktestsupport.modules import all_modules # noqa