mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-11105: reduce the recursion limit for tests (GH-26550)
This commit is contained in:
parent
257e400a19
commit
e58d762c1f
2 changed files with 13 additions and 2 deletions
|
@ -1102,7 +1102,8 @@ Module(
|
|||
e = ast.UnaryOp(op=ast.Not(), lineno=0, col_offset=0)
|
||||
e.operand = e
|
||||
with self.assertRaises(RecursionError):
|
||||
compile(ast.Expression(e), "<test>", "eval")
|
||||
with support.infinite_recursion():
|
||||
compile(ast.Expression(e), "<test>", "eval")
|
||||
|
||||
def test_recursion_indirect(self):
|
||||
e = ast.UnaryOp(op=ast.Not(), lineno=0, col_offset=0)
|
||||
|
@ -1110,7 +1111,8 @@ Module(
|
|||
e.operand = f
|
||||
f.operand = e
|
||||
with self.assertRaises(RecursionError):
|
||||
compile(ast.Expression(e), "<test>", "eval")
|
||||
with support.infinite_recursion():
|
||||
compile(ast.Expression(e), "<test>", "eval")
|
||||
|
||||
|
||||
class ASTValidatorTests(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue