mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
gh-131421: Fix ASDL tests (#133408)
PR #131419 broke this, but we failed to run tests on the PR due to a bug in our script.
This commit is contained in:
parent
30840706b0
commit
483d130e50
2 changed files with 16 additions and 12 deletions
|
@ -62,17 +62,17 @@ class TestAsdlParser(unittest.TestCase):
|
|||
alias = self.types['alias']
|
||||
self.assertEqual(
|
||||
str(alias),
|
||||
'Product([Field(identifier, name), Field(identifier, asname, opt=True)], '
|
||||
'Product([Field(identifier, name), Field(identifier, asname, quantifiers=[OPTIONAL])], '
|
||||
'[Field(int, lineno), Field(int, col_offset), '
|
||||
'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])')
|
||||
'Field(int, end_lineno, quantifiers=[OPTIONAL]), Field(int, end_col_offset, quantifiers=[OPTIONAL])])')
|
||||
|
||||
def test_attributes(self):
|
||||
stmt = self.types['stmt']
|
||||
self.assertEqual(len(stmt.attributes), 4)
|
||||
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)')
|
||||
self.assertEqual(repr(stmt.attributes[2]), 'Field(int, end_lineno, quantifiers=[OPTIONAL])')
|
||||
self.assertEqual(repr(stmt.attributes[3]), 'Field(int, end_col_offset, quantifiers=[OPTIONAL])')
|
||||
|
||||
def test_constructor_fields(self):
|
||||
ehandler = self.types['excepthandler']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue