From 112cde8bfe70d9564e4686655729a1eb7525275d Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 4 Dec 2010 22:55:17 -0800 Subject: [PATCH] hide output in end-to-end tests --- runtests.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/runtests.py b/runtests.py index 8d966452..c5961b1b 100644 --- a/runtests.py +++ b/runtests.py @@ -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 -- 2.26.2