@@ -1000,7 +1000,7 @@ def test_tuple_with_complex_parentheses1(self):
10001000 ast_frag = patchedast .get_patched_ast (source , True )
10011001 checker = _ResultChecker (self , ast_frag )
10021002 checker .check_children (
1003- "Tuple" , ["(" , "" , " Tuple" , "" , "," , " " , NameConstant , "" , ")" ]
1003+ "Tuple" , ["Tuple" , "" , "," , " " , NameConstant ]
10041004 )
10051005
10061006 def test_tuple_with_complex_parentheses2 (self ):
@@ -1016,7 +1016,7 @@ def test_tuple_with_complex_parentheses3(self):
10161016 ast_frag = patchedast .get_patched_ast (source , True )
10171017 checker = _ResultChecker (self , ast_frag )
10181018 checker .check_children (
1019- "Tuple" , ["(" , "" , " Tuple" , "" , "," , " " , "Tuple" , "," , ") " ]
1019+ "Tuple" , ["Tuple" , "" , "," , " " , "Tuple" ]
10201020 )
10211021
10221022 def test_one_item_tuple_node (self ):
@@ -1036,7 +1036,7 @@ def test_empty_tuple_node2(self):
10361036 ast_frag = patchedast .get_patched_ast (source , True )
10371037 checker = _ResultChecker (self , ast_frag )
10381038 checker .check_children (
1039- "Tuple" , ["(" , "" , " Tuple" , "" , "," , " " , NameConstant , "" , ")" ]
1039+ "Tuple" , ["Tuple" , "" , "," , " " , NameConstant ]
10401040 )
10411041
10421042 def test_empty_tuple_node3 (self ):
@@ -1047,6 +1047,12 @@ def test_empty_tuple_node3(self):
10471047 "Tuple" , ["Tuple" , "" , "," , " " , NameConstant ]
10481048 )
10491049
1050+ def test_empty_tuple_node4 (self ):
1051+ source = "a = (\n # foo,\n )\n "
1052+ ast_frag = patchedast .get_patched_ast (source , True )
1053+ checker = _ResultChecker (self , ast_frag )
1054+ checker .check_children ("Tuple" , ["(\n # foo,\n )" ])
1055+
10501056 def test_yield_node (self ):
10511057 source = dedent ("""\
10521058 def f():
@@ -1575,6 +1581,8 @@ def check_children(self, text, children):
15751581 if node is None :
15761582 self .test_case .fail ("Node <%s> cannot be found" % text )
15771583 result = list (node .sorted_children )
1584+ print (children )
1585+ print (result )
15781586 self .test_case .assertEqual (len (children ), len (result ))
15791587 for expected , child in zip (children , result ):
15801588 goals = expected
0 commit comments