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):