From: Kirill Podoprigora Date: Thu, 29 Feb 2024 14:59:24 +0000 (+0200) Subject: gh-116100: Add `test` arg to `ast.If` and `op` arg to `ast.BoolOp` calls (#116101) X-Git-Tag: v3.13.0a5~184 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a86030bc2519b4a6b055e0b47b9870c86db8588;p=thirdparty%2FPython%2Fcpython.git gh-116100: Add `test` arg to `ast.If` and `op` arg to `ast.BoolOp` calls (#116101) --- diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 012678098205..d3e69bfedccd 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -527,11 +527,11 @@ class TestSpecifics(unittest.TestCase): self.assertRaises(TypeError, compile, co1, '', 'eval') # raise exception when node type is no start node - self.assertRaises(TypeError, compile, _ast.If(), '', 'exec') + self.assertRaises(TypeError, compile, _ast.If(test=_ast.Name(id='x', ctx=_ast.Load())), '', 'exec') # raise exception when node has invalid children ast = _ast.Module() - ast.body = [_ast.BoolOp()] + ast.body = [_ast.BoolOp(op=_ast.Or())] self.assertRaises(TypeError, compile, ast, '', 'exec') def test_compile_invalid_typealias(self):