mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
test expect base classes
This commit is contained in:
parent
8319170abb
commit
26a93c0082
1 changed files with 8 additions and 0 deletions
|
@ -161,6 +161,14 @@ class AST_Tests(unittest.TestCase):
|
|||
im = ast.parse("from . import y").body[0]
|
||||
self.assertIsNone(im.module)
|
||||
|
||||
def test_base_classes(self):
|
||||
self.assertTrue(issubclass(ast.For, ast.stmt))
|
||||
self.assertTrue(issubclass(ast.Name, ast.expr))
|
||||
self.assertTrue(issubclass(ast.stmt, ast.AST))
|
||||
self.assertTrue(issubclass(ast.expr, ast.AST))
|
||||
self.assertTrue(issubclass(ast.comprehension, ast.AST))
|
||||
self.assertTrue(issubclass(ast.Gt, ast.AST))
|
||||
|
||||
def test_nodeclasses(self):
|
||||
x = ast.BinOp(1, 2, 3, lineno=0)
|
||||
self.assertEquals(x.left, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue