From 0b03efae68bd4cf53d1372c3159e0fb78be36e7d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 21 Apr 2011 07:13:14 +0200 Subject: [PATCH] disable unknown names check for pyregr tests --- runtests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 085b6c65..1aed0fcc 100644 --- a/runtests.py +++ b/runtests.py @@ -353,6 +353,8 @@ class CythonCompileTestCase(unittest.TestCase): def setUp(self): from Cython.Compiler import Options + self._saved_options = [ (name, getattr(Options, name)) + for name in ('warning_errors', 'error_on_unknown_names') ] Options.warning_errors = self.warning_errors if self.workdir not in sys.path: @@ -360,7 +362,8 @@ class CythonCompileTestCase(unittest.TestCase): def tearDown(self): from Cython.Compiler import Options - Options.warning_errors = False + for name, value in self._saved_options: + setattr(Options, name, value) try: sys.path.remove(self.workdir) @@ -738,6 +741,11 @@ class CythonUnitTestCase(CythonRunTestCase): class CythonPyregrTestCase(CythonRunTestCase): + def setUp(self): + CythonRunTestCase.setUp(self) + from Cython.Compiler import Options + Options.error_on_unknown_names = False + def _run_unittest(self, result, *classes): """Run tests from unittest.TestCase-derived classes.""" valid_types = (unittest.TestSuite, unittest.TestCase) -- 2.26.2