@@ -341,6 +341,8 @@ def test_non_interned_future_from_ast(self):
341
341
mod .body [0 ].module = " __future__ " .strip ()
342
342
compile (mod , "<test>" , "exec" )
343
343
344
+ # TODO: RUSTPYTHON
345
+ @unittest .expectedFailure
344
346
def test_alias (self ):
345
347
im = ast .parse ("from bar import y" ).body [0 ]
346
348
self .assertEqual (len (im .names ), 1 )
@@ -705,6 +707,8 @@ def test_issue39579_dotted_name_end_col_offset(self):
705
707
attr_b = tree .body [0 ].decorator_list [0 ].value
706
708
self .assertEqual (attr_b .end_col_offset , 4 )
707
709
710
+ # TODO: RUSTPYTHON
711
+ @unittest .expectedFailure
708
712
def test_ast_asdl_signature (self ):
709
713
self .assertEqual (ast .withitem .__doc__ , "withitem(expr context_expr, expr? optional_vars)" )
710
714
self .assertEqual (ast .GtE .__doc__ , "GtE" )
@@ -714,6 +718,8 @@ def test_ast_asdl_signature(self):
714
718
expressions [0 ] = f"expr = { ast .expr .__subclasses__ ()[0 ].__doc__ } "
715
719
self .assertCountEqual (ast .expr .__doc__ .split ("\n " ), expressions )
716
720
721
+ # TODO: RUSTPYTHON
722
+ @unittest .expectedFailure
717
723
def test_parenthesized_with_feature_version (self ):
718
724
ast .parse ('with (CtxManager() as example): ...' , feature_version = (3 , 10 ))
719
725
# While advertised as a feature in Python 3.10, this was allowed starting 3.9
@@ -729,6 +735,8 @@ def test_issue40614_feature_version(self):
729
735
with self .assertRaises (SyntaxError ):
730
736
ast .parse ('f"{x=}"' , feature_version = (3 , 7 ))
731
737
738
+ # TODO: RUSTPYTHON
739
+ @unittest .expectedFailure
732
740
def test_assignment_expression_feature_version (self ):
733
741
ast .parse ('(x := 0)' , feature_version = (3 , 8 ))
734
742
with self .assertRaises (SyntaxError ):
@@ -785,6 +793,8 @@ def test_dump(self):
785
793
"lineno=1, col_offset=0, end_lineno=1, end_col_offset=24)], type_ignores=[])"
786
794
)
787
795
796
+ # TODO: RUSTPYTHON; redundant kind for Contant node
797
+ @unittest .expectedFailure
788
798
def test_dump_indent (self ):
789
799
node = ast .parse ('spam(eggs, "and cheese")' )
790
800
self .assertEqual (ast .dump (node , indent = 3 ), """\
@@ -947,6 +957,8 @@ def test_iter_fields(self):
947
957
self .assertEqual (d .pop ('func' ).id , 'foo' )
948
958
self .assertEqual (d , {'keywords' : [], 'args' : []})
949
959
960
+ # TODO: RUSTPYTHON; redundant kind for Contant node
961
+ @unittest .expectedFailure
950
962
def test_iter_child_nodes (self ):
951
963
node = ast .parse ("spam(23, 42, eggs='leek')" , mode = 'eval' )
952
964
self .assertEqual (len (list (ast .iter_child_nodes (node .body ))), 4 )
@@ -1089,6 +1101,8 @@ def test_literal_eval_malformed_dict_nodes(self):
1089
1101
malformed = ast .Dict (keys = [ast .Constant (1 )], values = [ast .Constant (2 ), ast .Constant (3 )])
1090
1102
self .assertRaises (ValueError , ast .literal_eval , malformed )
1091
1103
1104
+ # TODO: RUSTPYTHON
1105
+ @unittest .expectedFailure
1092
1106
def test_literal_eval_trailing_ws (self ):
1093
1107
self .assertEqual (ast .literal_eval (" -1" ), - 1 )
1094
1108
self .assertEqual (ast .literal_eval ("\t \t -1" ), - 1 )
@@ -1107,6 +1121,8 @@ def test_literal_eval_malformed_lineno(self):
1107
1121
with self .assertRaisesRegex (ValueError , msg ):
1108
1122
ast .literal_eval (node )
1109
1123
1124
+ # TODO: RUSTPYTHON
1125
+ @unittest .expectedFailure
1110
1126
def test_literal_eval_syntax_errors (self ):
1111
1127
with self .assertRaisesRegex (SyntaxError , "unexpected indent" ):
1112
1128
ast .literal_eval (r'''
@@ -1127,8 +1143,6 @@ def test_bad_integer(self):
1127
1143
compile (mod , 'test' , 'exec' )
1128
1144
self .assertIn ("invalid integer value: None" , str (cm .exception ))
1129
1145
1130
- # TODO: RUSTPYTHON
1131
- @unittest .expectedFailure
1132
1146
def test_level_as_none (self ):
1133
1147
body = [ast .ImportFrom (module = 'time' ,
1134
1148
names = [ast .alias (name = 'sleep' ,
@@ -1141,13 +1155,15 @@ def test_level_as_none(self):
1141
1155
exec (code , ns )
1142
1156
self .assertIn ('sleep' , ns )
1143
1157
1158
+ @unittest .skip ("TODO: RUSTPYTHON; crash" )
1144
1159
def test_recursion_direct (self ):
1145
1160
e = ast .UnaryOp (op = ast .Not (), lineno = 0 , col_offset = 0 )
1146
1161
e .operand = e
1147
1162
with self .assertRaises (RecursionError ):
1148
1163
with support .infinite_recursion ():
1149
1164
compile (ast .Expression (e ), "<test>" , "eval" )
1150
1165
1166
+ @unittest .skip ("TODO: RUSTPYTHON; crash" )
1151
1167
def test_recursion_indirect (self ):
1152
1168
e = ast .UnaryOp (op = ast .Not (), lineno = 0 , col_offset = 0 )
1153
1169
f = ast .UnaryOp (op = ast .Not (), lineno = 0 , col_offset = 0 )
@@ -2295,6 +2311,8 @@ class C:
2295
2311
cdef = ast .parse (s ).body [0 ]
2296
2312
self .assertEqual (ast .get_source_segment (s , cdef .body [0 ], padded = True ), s_method )
2297
2313
2314
+ # TODO: RUSTPYTHON
2315
+ @unittest .expectedFailure
2298
2316
def test_source_segment_missing_info (self ):
2299
2317
s = 'v = 1\r \n w = 1\n x = 1\n \r y = 1\r \n '
2300
2318
v , w , x , y = ast .parse (s ).body
0 commit comments