mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
bpo-39638: Keep ASDL signatures in the AST nodes (GH-18515)
This commit is contained in:
parent
5b66ec166b
commit
4ab362cec6
7 changed files with 343 additions and 132 deletions
|
|
@ -63,10 +63,10 @@ class TestAsdlParser(unittest.TestCase):
|
|||
def test_attributes(self):
|
||||
stmt = self.types['stmt']
|
||||
self.assertEqual(len(stmt.attributes), 4)
|
||||
self.assertEqual(str(stmt.attributes[0]), 'Field(int, lineno)')
|
||||
self.assertEqual(str(stmt.attributes[1]), 'Field(int, col_offset)')
|
||||
self.assertEqual(str(stmt.attributes[2]), 'Field(int, end_lineno, opt=True)')
|
||||
self.assertEqual(str(stmt.attributes[3]), 'Field(int, end_col_offset, opt=True)')
|
||||
self.assertEqual(repr(stmt.attributes[0]), 'Field(int, lineno)')
|
||||
self.assertEqual(repr(stmt.attributes[1]), 'Field(int, col_offset)')
|
||||
self.assertEqual(repr(stmt.attributes[2]), 'Field(int, end_lineno, opt=True)')
|
||||
self.assertEqual(repr(stmt.attributes[3]), 'Field(int, end_col_offset, opt=True)')
|
||||
|
||||
def test_constructor_fields(self):
|
||||
ehandler = self.types['excepthandler']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue