@@ -120,6 +120,8 @@ def expand(it, i=0):
120
120
c = expand (compare [took :])
121
121
self .assertEqual (a , c );
122
122
123
+ # TODO: RUSTPYTHON
124
+ @unittest .expectedFailure
123
125
def test_accumulate (self ):
124
126
self .assertEqual (list (accumulate (range (10 ))), # one positional arg
125
127
[0 , 1 , 3 , 6 , 10 , 15 , 21 , 28 , 36 , 45 ])
@@ -177,6 +179,8 @@ def test_chain_from_iterable(self):
177
179
self .assertEqual (take (4 , chain .from_iterable (['abc' , 'def' ])), list ('abcd' ))
178
180
self .assertRaises (TypeError , list , chain .from_iterable ([2 , 3 ]))
179
181
182
+ # TODO: RUSTPYTHON
183
+ @unittest .expectedFailure
180
184
def test_chain_reducible (self ):
181
185
for oper in [copy .deepcopy ] + picklecopiers :
182
186
it = chain ('abc' , 'def' )
@@ -190,6 +194,8 @@ def test_chain_reducible(self):
190
194
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
191
195
self .pickletest (proto , chain ('abc' , 'def' ), compare = list ('abcdef' ))
192
196
197
+ # TODO: RUSTPYTHON
198
+ @unittest .expectedFailure
193
199
def test_chain_setstate (self ):
194
200
self .assertRaises (TypeError , chain ().__setstate__ , ())
195
201
self .assertRaises (TypeError , chain ().__setstate__ , [])
@@ -203,6 +209,8 @@ def test_chain_setstate(self):
203
209
it .__setstate__ ((iter (['abc' , 'def' ]), iter (['ghi' ])))
204
210
self .assertEqual (list (it ), ['ghi' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
205
211
212
+ # TODO: RUSTPYTHON
213
+ @unittest .expectedFailure
206
214
def test_combinations (self ):
207
215
self .assertRaises (TypeError , combinations , 'abc' ) # missing r argument
208
216
self .assertRaises (TypeError , combinations , 'abc' , 2 , 1 ) # too many arguments
@@ -294,6 +302,8 @@ def test_combinations_tuple_reuse(self):
294
302
self .assertEqual (len (set (map (id , combinations ('abcde' , 3 )))), 1 )
295
303
self .assertNotEqual (len (set (map (id , list (combinations ('abcde' , 3 ))))), 1 )
296
304
305
+ # TODO: RUSTPYTHON
306
+ @unittest .expectedFailure
297
307
def test_combinations_with_replacement (self ):
298
308
cwr = combinations_with_replacement
299
309
self .assertRaises (TypeError , cwr , 'abc' ) # missing r argument
@@ -382,6 +392,8 @@ def test_combinations_with_replacement_tuple_reuse(self):
382
392
self .assertEqual (len (set (map (id , cwr ('abcde' , 3 )))), 1 )
383
393
self .assertNotEqual (len (set (map (id , list (cwr ('abcde' , 3 ))))), 1 )
384
394
395
+ # TODO: RUSTPYTHON - panics with 'index out of bounds: the len is 0 but the index is 18446744073709551615'
396
+ @unittest .skip ("panics" )
385
397
def test_permutations (self ):
386
398
self .assertRaises (TypeError , permutations ) # too few arguments
387
399
self .assertRaises (TypeError , permutations , 'abc' , 2 , 1 ) # too many arguments
@@ -455,6 +467,8 @@ def test_permutations_tuple_reuse(self):
455
467
self .assertEqual (len (set (map (id , permutations ('abcde' , 3 )))), 1 )
456
468
self .assertNotEqual (len (set (map (id , list (permutations ('abcde' , 3 ))))), 1 )
457
469
470
+ # TODO: RUSTPYTHON - panics with 'index out of bounds: the len is 0 but the index is 18446744073709551615'
471
+ @unittest .skip ("panics" )
458
472
def test_combinatorics (self ):
459
473
# Test relationships between product(), permutations(),
460
474
# combinations() and combinations_with_replacement().
@@ -488,6 +502,8 @@ def test_combinatorics(self):
488
502
self .assertEqual (comb , list (filter (set (perm ).__contains__ , cwr ))) # comb: cwr that is a perm
489
503
self .assertEqual (comb , sorted (set (cwr ) & set (perm ))) # comb: both a cwr and a perm
490
504
505
+ # TODO: RUSTPYTHON
506
+ @unittest .expectedFailure
491
507
def test_compress (self ):
492
508
self .assertEqual (list (compress (data = 'ABCDEF' , selectors = [1 ,0 ,1 ,0 ,1 ,1 ])), list ('ACEF' ))
493
509
self .assertEqual (list (compress ('ABCDEF' , [1 ,0 ,1 ,0 ,1 ,1 ])), list ('ACEF' ))
@@ -521,7 +537,8 @@ def test_compress(self):
521
537
next (testIntermediate )
522
538
self .assertEqual (list (op (testIntermediate )), list (result2 ))
523
539
524
-
540
+ # TODO: RUSTPYTHON
541
+ @unittest .expectedFailure
525
542
def test_count (self ):
526
543
self .assertEqual (lzip ('abc' ,count ()), [('a' , 0 ), ('b' , 1 ), ('c' , 2 )])
527
544
self .assertEqual (lzip ('abc' ,count (3 )), [('a' , 3 ), ('b' , 4 ), ('c' , 5 )])
@@ -570,6 +587,8 @@ def test_count(self):
570
587
#check proper internal error handling for large "step' sizes
571
588
count (1 , maxsize + 5 ); sys .exc_info ()
572
589
590
+ # TODO: RUSTPYTHON
591
+ @unittest .expectedFailure
573
592
def test_count_with_stride (self ):
574
593
self .assertEqual (lzip ('abc' ,count (2 ,3 )), [('a' , 2 ), ('b' , 5 ), ('c' , 8 )])
575
594
self .assertEqual (lzip ('abc' ,count (start = 2 ,step = 3 )),
@@ -625,6 +644,8 @@ def test_count_with_stride(self):
625
644
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
626
645
self .pickletest (proto , count (i , j ))
627
646
647
+ # TODO: RUSTPYTHON
648
+ @unittest .expectedFailure
628
649
def test_cycle (self ):
629
650
self .assertEqual (take (10 , cycle ('abc' )), list ('abcabcabca' ))
630
651
self .assertEqual (list (cycle ('' )), [])
@@ -667,6 +688,8 @@ def test_cycle(self):
667
688
d = pickle .loads (p ) # rebuild the cycle object
668
689
self .assertEqual (take (20 , d ), list ('cdeabcdeabcdeabcdeab' ))
669
690
691
+ # TODO: RUSTPYTHON
692
+ @unittest .expectedFailure
670
693
def test_cycle_setstate (self ):
671
694
# Verify both modes for restoring state
672
695
@@ -703,6 +726,8 @@ def test_cycle_setstate(self):
703
726
self .assertRaises (TypeError , cycle ('' ).__setstate__ , ())
704
727
self .assertRaises (TypeError , cycle ('' ).__setstate__ , ([],))
705
728
729
+ # TODO: RUSTPYTHON
730
+ @unittest .expectedFailure
706
731
def test_groupby (self ):
707
732
# Check whether it accepts arguments correctly
708
733
self .assertEqual ([], list (groupby ([])))
@@ -833,6 +858,8 @@ def keyfunc(obj):
833
858
keyfunc .skip = 1
834
859
self .assertRaises (ExpectedError , gulp , [None , None ], keyfunc )
835
860
861
+ # TODO: RUSTPYTHON
862
+ @unittest .expectedFailure
836
863
def test_filter (self ):
837
864
self .assertEqual (list (filter (isEven , range (6 ))), [0 ,2 ,4 ])
838
865
self .assertEqual (list (filter (None , [0 ,1 ,0 ,2 ,0 ])), [1 ,2 ])
@@ -860,6 +887,8 @@ def test_filter(self):
860
887
c = filter (isEven , range (6 ))
861
888
self .pickletest (proto , c )
862
889
890
+ # TODO: RUSTPYTHON
891
+ @unittest .expectedFailure
863
892
def test_filterfalse (self ):
864
893
self .assertEqual (list (filterfalse (isEven , range (6 ))), [1 ,3 ,5 ])
865
894
self .assertEqual (list (filterfalse (None , [0 ,1 ,0 ,2 ,0 ])), [0 ,0 ,0 ])
@@ -965,6 +994,8 @@ def test_zip_longest_tuple_reuse(self):
965
994
ids = list (map (id , list (zip_longest ('abc' , 'def' ))))
966
995
self .assertEqual (len (dict .fromkeys (ids )), len (ids ))
967
996
997
+ # TODO: RUSTPYTHON
998
+ @unittest .expectedFailure
968
999
def test_zip_longest_pickling (self ):
969
1000
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
970
1001
self .pickletest (proto , zip_longest ("abc" , "def" ))
@@ -1024,6 +1055,8 @@ def run(r1, r2):
1024
1055
self .assertEqual (next (it ), (1 , 2 ))
1025
1056
self .assertRaises (RuntimeError , next , it )
1026
1057
1058
+ # TODO: RUSTPYTHON - panics with 'index out of bounds: the len is 0 but the index is 18446744073709551615'
1059
+ @unittest .skip ("panics" )
1027
1060
def test_product (self ):
1028
1061
for args , result in [
1029
1062
([], [()]), # zero iterables
@@ -1092,6 +1125,8 @@ def test_product_tuple_reuse(self):
1092
1125
self .assertEqual (len (set (map (id , product ('abc' , 'def' )))), 1 )
1093
1126
self .assertNotEqual (len (set (map (id , list (product ('abc' , 'def' ))))), 1 )
1094
1127
1128
+ # TODO: RUSTPYTHON - panics with 'index out of bounds: the len is 0 but the index is 18446744073709551615'
1129
+ @unittest .skip ("panics" )
1095
1130
def test_product_pickling (self ):
1096
1131
# check copy, deepcopy, pickle
1097
1132
for args , result in [
@@ -1107,6 +1142,8 @@ def test_product_pickling(self):
1107
1142
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
1108
1143
self .pickletest (proto , product (* args ))
1109
1144
1145
+ # TODO: RUSTPYTHON
1146
+ @unittest .expectedFailure
1110
1147
def test_product_issue_25021 (self ):
1111
1148
# test that indices are properly clamped to the length of the tuples
1112
1149
p = product ((1 , 2 ),(3 ,))
@@ -1117,6 +1154,8 @@ def test_product_issue_25021(self):
1117
1154
p .__setstate__ ((0 , 0 , 0x1000 )) # will access tuple element 1 if not clamped
1118
1155
self .assertRaises (StopIteration , next , p )
1119
1156
1157
+ # TODO: RUSTPYTHON
1158
+ @unittest .expectedFailure
1120
1159
def test_repeat (self ):
1121
1160
self .assertEqual (list (repeat (object = 'a' , times = 3 )), ['a' , 'a' , 'a' ])
1122
1161
self .assertEqual (lzip (range (3 ),repeat ('a' )),
@@ -1143,12 +1182,16 @@ def test_repeat(self):
1143
1182
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
1144
1183
self .pickletest (proto , repeat (object = 'a' , times = 10 ))
1145
1184
1185
+ # TODO: RUSTPYTHON
1186
+ @unittest .expectedFailure
1146
1187
def test_repeat_with_negative_times (self ):
1147
1188
self .assertEqual (repr (repeat ('a' , - 1 )), "repeat('a', 0)" )
1148
1189
self .assertEqual (repr (repeat ('a' , - 2 )), "repeat('a', 0)" )
1149
1190
self .assertEqual (repr (repeat ('a' , times = - 1 )), "repeat('a', 0)" )
1150
1191
self .assertEqual (repr (repeat ('a' , times = - 2 )), "repeat('a', 0)" )
1151
1192
1193
+ # TODO: RUSTPYTHON
1194
+ @unittest .expectedFailure
1152
1195
def test_map (self ):
1153
1196
self .assertEqual (list (map (operator .pow , range (3 ), range (1 ,7 ))),
1154
1197
[0 ** 1 , 1 ** 2 , 2 ** 3 ])
@@ -1179,6 +1222,8 @@ def test_map(self):
1179
1222
c = map (tupleize , 'abc' , count ())
1180
1223
self .pickletest (proto , c )
1181
1224
1225
+ # TODO: RUSTPYTHON
1226
+ @unittest .expectedFailure
1182
1227
def test_starmap (self ):
1183
1228
self .assertEqual (list (starmap (operator .pow , zip (range (3 ), range (1 ,7 )))),
1184
1229
[0 ** 1 , 1 ** 2 , 2 ** 3 ])
@@ -1206,6 +1251,8 @@ def test_starmap(self):
1206
1251
c = starmap (operator .pow , zip (range (3 ), range (1 ,7 )))
1207
1252
self .pickletest (proto , c )
1208
1253
1254
+ # TODO: RUSTPYTHON
1255
+ @unittest .expectedFailure
1209
1256
def test_islice (self ):
1210
1257
for args in [ # islice(args) should agree with range(args)
1211
1258
(10 , 20 , 3 ),
@@ -1300,6 +1347,8 @@ def __index__(self):
1300
1347
self .assertEqual (list (islice (range (100 ), IntLike (10 ), IntLike (50 ), IntLike (5 ))),
1301
1348
list (range (10 ,50 ,5 )))
1302
1349
1350
+ # TODO: RUSTPYTHON
1351
+ @unittest .expectedFailure
1303
1352
def test_takewhile (self ):
1304
1353
data = [1 , 3 , 5 , 20 , 2 , 4 , 6 , 8 ]
1305
1354
self .assertEqual (list (takewhile (underten , data )), [1 , 3 , 5 ])
@@ -1320,6 +1369,8 @@ def test_takewhile(self):
1320
1369
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
1321
1370
self .pickletest (proto , takewhile (underten , data ))
1322
1371
1372
+ # TODO: RUSTPYTHON
1373
+ @unittest .expectedFailure
1323
1374
def test_dropwhile (self ):
1324
1375
data = [1 , 3 , 5 , 20 , 2 , 4 , 6 , 8 ]
1325
1376
self .assertEqual (list (dropwhile (underten , data )), [20 , 2 , 4 , 6 , 8 ])
@@ -1337,6 +1388,8 @@ def test_dropwhile(self):
1337
1388
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
1338
1389
self .pickletest (proto , dropwhile (underten , data ))
1339
1390
1391
+ # TODO: RUSTPYTHON
1392
+ @unittest .expectedFailure
1340
1393
def test_tee (self ):
1341
1394
n = 200
1342
1395
@@ -1486,6 +1539,8 @@ def test_tee(self):
1486
1539
self .pickletest (proto , b , compare = ans )
1487
1540
1488
1541
# Issue 13454: Crash when deleting backward iterator from tee()
1542
+ # TODO: RUSTPYTHON
1543
+ @unittest .skip ("hangs" )
1489
1544
def test_tee_del_backward (self ):
1490
1545
forward , backward = tee (repeat (None , 20000000 ))
1491
1546
try :
@@ -1495,6 +1550,8 @@ def test_tee_del_backward(self):
1495
1550
del forward , backward
1496
1551
raise
1497
1552
1553
+ # TODO: RUSTPYTHON
1554
+ @unittest .expectedFailure
1498
1555
def test_tee_reenter (self ):
1499
1556
class I :
1500
1557
first = True
@@ -1510,6 +1567,8 @@ def __next__(self):
1510
1567
with self .assertRaisesRegex (RuntimeError , "tee" ):
1511
1568
next (a )
1512
1569
1570
+ # TODO: RUSTPYTHON - hangs
1571
+ @unittest .skip ("hangs" )
1513
1572
def test_tee_concurrent (self ):
1514
1573
start = threading .Event ()
1515
1574
finish = threading .Event ()
@@ -1559,6 +1618,8 @@ class TestExamples(unittest.TestCase):
1559
1618
def test_accumulate (self ):
1560
1619
self .assertEqual (list (accumulate ([1 ,2 ,3 ,4 ,5 ])), [1 , 3 , 6 , 10 , 15 ])
1561
1620
1621
+ # TODO: RUSTPYTHON
1622
+ @unittest .expectedFailure
1562
1623
def test_accumulate_reducible (self ):
1563
1624
# check copy, deepcopy, pickle
1564
1625
data = [1 , 2 , 3 , 4 , 5 ]
@@ -1574,6 +1635,8 @@ def test_accumulate_reducible(self):
1574
1635
self .assertEqual (list (copy .deepcopy (it )), accumulated [1 :])
1575
1636
self .assertEqual (list (copy .copy (it )), accumulated [1 :])
1576
1637
1638
+ # TODO: RUSTPYTHON
1639
+ @unittest .expectedFailure
1577
1640
def test_accumulate_reducible_none (self ):
1578
1641
# Issue #25718: total is None
1579
1642
it = accumulate ([None , None , None ], operator .is_ )
@@ -1627,6 +1690,8 @@ def test_filterfalse(self):
1627
1690
def test_map (self ):
1628
1691
self .assertEqual (list (map (pow , (2 ,3 ,10 ), (5 ,2 ,3 ))), [32 , 9 , 1000 ])
1629
1692
1693
+ # TODO: RUSTPYTHON
1694
+ @unittest .expectedFailure
1630
1695
def test_islice (self ):
1631
1696
self .assertEqual (list (islice ('ABCDEFG' , 2 )), list ('AB' ))
1632
1697
self .assertEqual (list (islice ('ABCDEFG' , 2 , 4 )), list ('CD' ))
@@ -1885,7 +1950,6 @@ def L(seqn):
1885
1950
1886
1951
1887
1952
class TestVariousIteratorArgs (unittest .TestCase ):
1888
-
1889
1953
def test_accumulate (self ):
1890
1954
s = [1 ,2 ,3 ,4 ,5 ]
1891
1955
r = [1 ,3 ,6 ,10 ,15 ]
@@ -2041,11 +2105,15 @@ def test_tee(self):
2041
2105
2042
2106
class LengthTransparency (unittest .TestCase ):
2043
2107
2108
+ # TODO: RUSTPYTHON
2109
+ @unittest .expectedFailure
2044
2110
def test_repeat (self ):
2045
2111
self .assertEqual (operator .length_hint (repeat (None , 50 )), 50 )
2046
2112
self .assertEqual (operator .length_hint (repeat (None , 0 )), 0 )
2047
2113
self .assertEqual (operator .length_hint (repeat (None ), 12 ), 12 )
2048
2114
2115
+ # TODO: RUSTPYTHON
2116
+ @unittest .expectedFailure
2049
2117
def test_repeat_with_negative_times (self ):
2050
2118
self .assertEqual (operator .length_hint (repeat (None , - 1 )), 0 )
2051
2119
self .assertEqual (operator .length_hint (repeat (None , - 2 )), 0 )
@@ -2145,6 +2213,8 @@ def __eq__(self, other):
2145
2213
2146
2214
2147
2215
class SubclassWithKwargsTest (unittest .TestCase ):
2216
+ # TODO: RUSTPYTHON
2217
+ @unittest .expectedFailure
2148
2218
def test_keywords_in_subclass (self ):
2149
2219
# count is not subclassable...
2150
2220
for cls in (repeat , zip , filter , filterfalse , chain , map ,
@@ -2530,8 +2600,9 @@ def test_main(verbose=None):
2530
2600
counts [i ] = sys .gettotalrefcount ()
2531
2601
print (counts )
2532
2602
2603
+ # TODO: RUSTPYTHON this hangs or is very slow
2533
2604
# doctest the examples in the library reference
2534
- support .run_doctest (sys .modules [__name__ ], verbose )
2605
+ # support.run_doctest(sys.modules[__name__], verbose)
2535
2606
2536
2607
if __name__ == "__main__" :
2537
2608
test_main (verbose = True )
0 commit comments