Skip to content

Commit 17a554f

Browse files
committed
fix test_unparse
1 parent 480ac8e commit 17a554f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_unparse.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,11 @@ def test_docstrings(self):
422422
self.check_ast_roundtrip(f"'''{docstring}'''")
423423

424424
def test_constant_tuples(self):
425-
self.check_src_roundtrip(ast.Module([ast.Constant(value=(1,))]), "(1,)")
425+
locs = ast.fix_missing_locations
426426
self.check_src_roundtrip(
427-
ast.Module([ast.Constant(value=(1, 2, 3))]), "(1, 2, 3)"
427+
locs(ast.Module([ast.Expr(ast.Constant(value=(1,)))])), "(1,)")
428+
self.check_src_roundtrip(
429+
locs(ast.Module([ast.Expr(ast.Constant(value=(1, 2, 3)))])), "(1, 2, 3)"
428430
)
429431

430432
def test_function_type(self):

0 commit comments

Comments
 (0)