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