Commit 112cde8b authored by Robert Bradshaw's avatar Robert Bradshaw

hide output in end-to-end tests

parent 56b25a9c
......@@ -9,6 +9,7 @@ import shutil
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
try:
......@@ -714,7 +715,8 @@ class EndToEndTest(unittest.TestCase):
def setUp(self):
from Cython.TestUtils import unpack_source_tree
_, self.commands = unpack_source_tree(os.path.join('tests', 'build', self.treefile), self.workdir)
_, self.commands = unpack_source_tree(
os.path.join('tests', 'build', self.treefile), self.workdir)
self.old_dir = os.getcwd()
os.chdir(self.workdir)
if self.workdir not in sys.path:
......@@ -731,9 +733,16 @@ class EndToEndTest(unittest.TestCase):
.replace("PYTHON", sys.executable))
old_path = os.environ.get('PYTHONPATH')
try:
os.environ['PYTHONPATH'] = self.cython_syspath + os.pathsep + (old_path or '')
print(os.environ['PYTHONPATH'])
self.assertEqual(0, os.system(commands))
os.environ['PYTHONPATH'] = os.path.join(self.cython_syspath, (old_path or ''))
p = subprocess.Popen(commands,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
shell=True)
res = p.wait()
if res != 0:
print p.stdout.read()
print p.stderr.read()
self.assertEqual(0, res)
finally:
if old_path:
os.environ['PYTHONPATH'] = old_path
......
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