bpo-39638: Keep ASDL signatures in the AST nodes (GH-18515)

This commit is contained in:
Batuhan Taşkaya 2020-03-16 11:12:53 +03:00 committed by GitHub
parent 5b66ec166b
commit 4ab362cec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 343 additions and 132 deletions

View file

@ -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']