mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-116100: Add test
arg to ast.If
and op
arg to ast.BoolOp
calls (#116101)
This commit is contained in:
parent
bea2795be2
commit
6a86030bc2
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue