From 34b72dc6fc511c900d0e27c415550fd625c4d724 Mon Sep 17 00:00:00 2001 From: da-woods Date: Sun, 17 Jul 2022 21:18:54 +0100 Subject: Substitute subtest of Python 2.7 --- tests/run/test_patma.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/run/test_patma.py b/tests/run/test_patma.py index 240dbf0d3..61ac6957f 100644 --- a/tests/run/test_patma.py +++ b/tests/run/test_patma.py @@ -59,6 +59,16 @@ else: # except for one test that seems misplaced in CPython (which is below) class TestTracing(unittest.TestCase): + if sys.version_info < (3, 4): + class SubTestClass(object): + def __enter__(self): + return self + def __exit__(self, exc_type, exc_value, traceback): + return + def __call__(self, *args): + return self + subTest = SubTestClass() + def test_parser_deeply_nested_patterns(self): # Deeply nested patterns can cause exponential backtracking when parsing. # See CPython gh-93671 for more information. -- cgit v1.2.1