Commit 166d2a51 authored by Stefan Behnel's avatar Stefan Behnel

work around missing unittest helper in test_grammar.py for older CPython versions

parent ce0ffa18
...@@ -1204,6 +1204,17 @@ class GrammarTests(unittest.TestCase): ...@@ -1204,6 +1204,17 @@ class GrammarTests(unittest.TestCase):
GrammarTests.assertRaisesRegex = lambda self, exc, msg: self.assertRaises(exc) GrammarTests.assertRaisesRegex = lambda self, exc, msg: self.assertRaises(exc)
if not hasattr(unittest.TestCase, 'subTest'):
@contextlib.contextmanager
def subTest(self, code, **kwargs):
try:
yield
except Exception:
print(code)
raise
GrammarTests.subTest = subTest
# FIXME: disabling some tests for real Cython bugs here # FIXME: disabling some tests for real Cython bugs here
del GrammarTests.test_comprehension_specials # iterable pre-calculation in generator expression del GrammarTests.test_comprehension_specials # iterable pre-calculation in generator expression
del GrammarTests.test_funcdef # annotation mangling del GrammarTests.test_funcdef # annotation mangling
......
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