Skip to content

Commit

Permalink
Avoid check_output to make older python happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Jan 24, 2017
1 parent cef5136 commit ef8349a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2048,13 +2048,12 @@ def test_user_configuration(self):
|finally:
| sc.stop()
""")
try:
subprocess.check_output(
[self.sparkSubmit, "--master", "local", script],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
# This gives us a better error message for debugging.
self.fail("Test exited with {0}, output:\n{1}".format(e.returncode, e.output))
proc = subprocess.Popen(
[self.sparkSubmit, "--master", "local", script],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out, err = proc.communicate()
self.assertEqual(0, proc.returncode, msg="Process failed with error:\n {0}".format(out))


class ContextTests(unittest.TestCase):
Expand Down

0 comments on commit ef8349a

Please sign in to comment.