From a18effd9e952665462c001f56ea1614f9533de58 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Tue, 19 May 2009 18:54:13 +0200 Subject: [PATCH] Redirect error output properly during unit testing --- Cython/TestUtils.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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") -- 2.26.2