]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116100: Add `test` arg to `ast.If` and `op` arg to `ast.BoolOp` calls (#116101)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Thu, 29 Feb 2024 14:59:24 +0000 (16:59 +0200)
committerGitHub <noreply@github.com>
Thu, 29 Feb 2024 14:59:24 +0000 (06:59 -0800)
Lib/test/test_compile.py

index 0126780982059a3b33a056ea16aafb289dec6a44..d3e69bfedccd07db43db413776bd2b7a3c44e2d6 100644 (file)
@@ -527,11 +527,11 @@ class TestSpecifics(unittest.TestCase):
         self.assertRaises(TypeError, compile, co1, '<ast>', 'eval')
 
         # raise exception when node type is no start node
-        self.assertRaises(TypeError, compile, _ast.If(), '<ast>', 'exec')
+        self.assertRaises(TypeError, compile, _ast.If(test=_ast.Name(id='x', ctx=_ast.Load())), '<ast>', '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, '<ast>', 'exec')
 
     def test_compile_invalid_typealias(self):