Commit d07748a1 authored by mattip's avatar mattip

MAINT: if subtree test fails, print out all stdout, stderr not just last

parent b6509bf7
...@@ -1735,6 +1735,9 @@ class EndToEndTest(unittest.TestCase): ...@@ -1735,6 +1735,9 @@ class EndToEndTest(unittest.TestCase):
old_path = os.environ.get('PYTHONPATH') old_path = os.environ.get('PYTHONPATH')
env = dict(os.environ) env = dict(os.environ)
env['PYTHONPATH'] = self.cython_syspath + os.pathsep + (old_path or '') env['PYTHONPATH'] = self.cython_syspath + os.pathsep + (old_path or '')
cmd = []
out = []
err = []
for command_no, command in enumerate(filter(None, commands.splitlines()), 1): for command_no, command in enumerate(filter(None, commands.splitlines()), 1):
with self.stats.time('%s(%d)' % (self.name, command_no), 'c', with self.stats.time('%s(%d)' % (self.name, command_no), 'c',
'etoe-build' if ' setup.py ' in command else 'etoe-run'): 'etoe-build' if ' setup.py ' in command else 'etoe-run'):
...@@ -1743,11 +1746,15 @@ class EndToEndTest(unittest.TestCase): ...@@ -1743,11 +1746,15 @@ class EndToEndTest(unittest.TestCase):
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
shell=True, shell=True,
env=env) env=env)
out, err = p.communicate() _out, _err = p.communicate()
cmd.append(command)
out.append(_out)
err.append(_err)
res = p.returncode res = p.returncode
if res != 0: if res != 0:
sys.stderr.write("%s\n%s\n%s\n" % ( for c, o, e in zip(cmd, out, err):
command, self._try_decode(out), self._try_decode(err))) sys.stderr.write("%s\n%s\n%s\n\n" % (
c, self._try_decode(o), self._try_decode(e)))
self.assertEqual(0, res, "non-zero exit status") self.assertEqual(0, res, "non-zero exit status")
self.success = True self.success = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment