From: Dag Sverre Seljebotn Date: Tue, 19 May 2009 16:54:13 +0000 (+0200) Subject: Redirect error output properly during unit testing X-Git-Tag: 0.11.2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a18effd9e952665462c001f56ea1614f9533de58;p=cython.git Redirect error output properly during unit testing --- diff --git a/Cython/TestUtils.py b/Cython/TestUtils.py index 9ed1b3b3..cd888dc0 100644 --- a/Cython/TestUtils.py +++ b/Cython/TestUtils.py @@ -38,6 +38,15 @@ def treetypes(root): class CythonTest(unittest.TestCase): + def setUp(self): + self.listing_file = Errors.listing_file + self.echo_file = Errors.echo_file + Errors.listing_file = Errors.echo_file = None + + def tearDown(self): + Errors.listing_file = self.listing_file + Errors.echo_file = self.echo_file + def assertLines(self, expected, result): "Checks that the given strings or lists of strings are equal line by line" if not isinstance(expected, list): expected = expected.split(u"\n")