Skip to content

Commit 1964549

Browse files
Eclips4pull[bot]
authored andcommitted
gh-116100: Add test arg to ast.If and op arg to ast.BoolOp calls (#116101)
1 parent 389ddea commit 1964549

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_compile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,11 @@ def test_compile_ast(self):
527527
self.assertRaises(TypeError, compile, co1, '<ast>', 'eval')
528528

529529
# raise exception when node type is no start node
530-
self.assertRaises(TypeError, compile, _ast.If(), '<ast>', 'exec')
530+
self.assertRaises(TypeError, compile, _ast.If(test=_ast.Name(id='x', ctx=_ast.Load())), '<ast>', 'exec')
531531

532532
# raise exception when node has invalid children
533533
ast = _ast.Module()
534-
ast.body = [_ast.BoolOp()]
534+
ast.body = [_ast.BoolOp(op=_ast.Or())]
535535
self.assertRaises(TypeError, compile, ast, '<ast>', 'exec')
536536

537537
def test_compile_invalid_typealias(self):

0 commit comments

Comments
 (0)