gh-130139: always check ast node type in ast.parse() with ast input (#130140)

This commit is contained in:
Irit Katriel 2025-02-16 13:32:39 +00:00 committed by GitHub
parent 2e8044a4f7
commit c9b1bf302c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 73 additions and 32 deletions

View file

@ -422,9 +422,9 @@ class UnparseTestCase(ASTTestCase):
self.check_ast_roundtrip(f"'''{docstring}'''")
def test_constant_tuples(self):
self.check_src_roundtrip(ast.Constant(value=(1,), kind=None), "(1,)")
self.check_src_roundtrip(ast.Module([ast.Constant(value=(1,))]), "(1,)")
self.check_src_roundtrip(
ast.Constant(value=(1, 2, 3), kind=None), "(1, 2, 3)"
ast.Module([ast.Constant(value=(1, 2, 3))]), "(1, 2, 3)"
)
def test_function_type(self):