@@ -86,6 +86,8 @@ def test_numeric_types(self):
86
86
if float (1 ) == 1.0 and float (- 1 ) == - 1.0 and float (0 ) == 0.0 : pass
87
87
else : self .fail ('float() does not work properly' )
88
88
89
+ # TODO: RUSTPYTHON
90
+ @unittest .expectedFailure
89
91
def test_float_to_string (self ):
90
92
def test (f , result ):
91
93
self .assertEqual (f .__format__ ('e' ), result )
@@ -206,6 +208,8 @@ def test_type_function(self):
206
208
self .assertRaises (TypeError , type , 1 , 2 )
207
209
self .assertRaises (TypeError , type , 1 , 2 , 3 , 4 )
208
210
211
+ # TODO: RUSTPYTHON
212
+ @unittest .expectedFailure
209
213
def test_int__format__ (self ):
210
214
def test (i , format_spec , result ):
211
215
# just make sure we have the unified type for integers
@@ -375,6 +379,8 @@ def test(i, format_spec, result):
375
379
test (123456 , "1=20" , '11111111111111123456' )
376
380
test (123456 , "*=20" , '**************123456' )
377
381
382
+ # TODO: RUSTPYTHON
383
+ @unittest .expectedFailure
378
384
@run_with_locale ('LC_NUMERIC' , 'en_US.UTF8' )
379
385
def test_float__format__locale (self ):
380
386
# test locale support for __format__ code 'n'
@@ -384,6 +390,8 @@ def test_float__format__locale(self):
384
390
self .assertEqual (locale .format_string ('%g' , x , grouping = True ), format (x , 'n' ))
385
391
self .assertEqual (locale .format_string ('%.10g' , x , grouping = True ), format (x , '.10n' ))
386
392
393
+ # TODO: RUSTPYTHON
394
+ @unittest .expectedFailure
387
395
@run_with_locale ('LC_NUMERIC' , 'en_US.UTF8' )
388
396
def test_int__format__locale (self ):
389
397
# test locale support for __format__ code 'n' for integers
@@ -403,6 +411,8 @@ def test_int__format__locale(self):
403
411
self .assertEqual (len (format (0 , lfmt )), len (format (x , lfmt )))
404
412
self .assertEqual (len (format (0 , cfmt )), len (format (x , cfmt )))
405
413
414
+ # TODO: RUSTPYTHON
415
+ @unittest .expectedFailure
406
416
def test_float__format__ (self ):
407
417
def test (f , format_spec , result ):
408
418
self .assertEqual (f .__format__ (format_spec ), result )
@@ -553,25 +563,29 @@ def test(f, format_spec, result):
553
563
test (12345.6 , "1=20" , '111111111111112345.6' )
554
564
test (12345.6 , "*=20" , '*************12345.6' )
555
565
556
- def test_format_spec_errors (self ):
557
- # int, float, and string all share the same format spec
558
- # mini-language parser.
566
+ # TODO: RUSTPYTHON
567
+ # @unittest.expectedFailure
568
+ # def test_format_spec_errors(self):
569
+ # # int, float, and string all share the same format spec
570
+ # # mini-language parser.
559
571
560
- # Check that we can't ask for too many digits. This is
561
- # probably a CPython specific test. It tries to put the width
562
- # into a C long.
563
- self .assertRaises (ValueError , format , 0 , '1' * 10000 + 'd' )
572
+ # # Check that we can't ask for too many digits. This is
573
+ # # probably a CPython specific test. It tries to put the width
574
+ # # into a C long.
575
+ # self.assertRaises(ValueError, format, 0, '1'*10000 + 'd')
564
576
565
- # Similar with the precision.
566
- self .assertRaises (ValueError , format , 0 , '.' + '1' * 10000 + 'd' )
577
+ # # Similar with the precision.
578
+ # self.assertRaises(ValueError, format, 0, '.' + '1'*10000 + 'd')
567
579
568
- # And may as well test both.
569
- self .assertRaises (ValueError , format , 0 , '1' * 1000 + '.' + '1' * 10000 + 'd' )
580
+ # # And may as well test both.
581
+ # self.assertRaises(ValueError, format, 0, '1'*1000 + '.' + '1'*10000 + 'd')
570
582
571
- # Make sure commas aren't allowed with various type codes
572
- for code in 'xXobns' :
573
- self .assertRaises (ValueError , format , 0 , ',' + code )
583
+ # # Make sure commas aren't allowed with various type codes
584
+ # for code in 'xXobns':
585
+ # self.assertRaises(ValueError, format, 0, ',' + code)
574
586
587
+ # TODO: RUSTPYTHON
588
+ @unittest .expectedFailure
575
589
def test_internal_sizes (self ):
576
590
self .assertGreater (object .__basicsize__ , 0 )
577
591
self .assertGreater (tuple .__itemsize__ , 0 )
@@ -588,6 +602,8 @@ def test_method_wrapper_types(self):
588
602
self .assertIsInstance (object ().__lt__ , types .MethodWrapperType )
589
603
self .assertIsInstance ((42 ).__lt__ , types .MethodWrapperType )
590
604
605
+ # TODO: RUSTPYTHON
606
+ @unittest .expectedFailure
591
607
def test_method_descriptor_types (self ):
592
608
self .assertIsInstance (str .join , types .MethodDescriptorType )
593
609
self .assertIsInstance (list .append , types .MethodDescriptorType )
@@ -602,6 +618,8 @@ def test_method_descriptor_types(self):
602
618
class MappingProxyTests (unittest .TestCase ):
603
619
mappingproxy = types .MappingProxyType
604
620
621
+ # TODO: RUSTPYTHON
622
+ @unittest .expectedFailure
605
623
def test_constructor (self ):
606
624
class userdict (dict ):
607
625
pass
@@ -617,6 +635,8 @@ class userdict(dict):
617
635
self .assertRaises (TypeError , self .mappingproxy , ("a" , "tuple" ))
618
636
self .assertRaises (TypeError , self .mappingproxy , ["a" , "list" ])
619
637
638
+ # TODO: RUSTPYTHON
639
+ @unittest .expectedFailure
620
640
def test_methods (self ):
621
641
attrs = set (dir (self .mappingproxy ({}))) - set (dir (object ()))
622
642
self .assertEqual (attrs , {
@@ -640,6 +660,8 @@ def test_get(self):
640
660
self .assertIsNone (view .get ('xxx' ))
641
661
self .assertEqual (view .get ('xxx' , 42 ), 42 )
642
662
663
+ # TODO: RUSTPYTHON
664
+ @unittest .expectedFailure
643
665
def test_missing (self ):
644
666
class dictmissing (dict ):
645
667
def __missing__ (self , key ):
@@ -654,6 +676,8 @@ def __missing__(self, key):
654
676
self .assertTrue ('x' in view )
655
677
self .assertFalse ('y' in view )
656
678
679
+ # TODO: RUSTPYTHON
680
+ @unittest .expectedFailure
657
681
def test_customdict (self ):
658
682
class customdict (dict ):
659
683
def __contains__ (self , key ):
@@ -702,6 +726,8 @@ def get(self, key, default=None):
702
726
self .assertEqual (view .keys (), 'keys' )
703
727
self .assertEqual (view .values (), 'values' )
704
728
729
+ # TODO: RUSTPYTHON
730
+ @unittest .expectedFailure
705
731
def test_chainmap (self ):
706
732
d1 = {'x' : 1 }
707
733
d2 = {'y' : 2 }
@@ -747,6 +773,8 @@ def test_views(self):
747
773
self .assertEqual (list (values ), ['value' ])
748
774
self .assertEqual (list (items ), [('key' , 'value' )])
749
775
776
+ # TODO: RUSTPYTHON
777
+ @unittest .expectedFailure
750
778
def test_len (self ):
751
779
for expected in range (6 ):
752
780
data = dict .fromkeys ('abcde' [:expected ])
@@ -764,6 +792,8 @@ def test_iterators(self):
764
792
self .assertEqual (set (view .values ()), set (values ))
765
793
self .assertEqual (set (view .items ()), set (items ))
766
794
795
+ # TODO: RUSTPYTHON
796
+ @unittest .expectedFailure
767
797
def test_copy (self ):
768
798
original = {'key1' : 27 , 'key2' : 51 , 'key3' : 93 }
769
799
view = self .mappingproxy (original )
@@ -799,6 +829,8 @@ def test_new_class_subclass(self):
799
829
C = types .new_class ("C" , (int ,))
800
830
self .assertTrue (issubclass (C , int ))
801
831
832
+ # TODO: RUSTPYTHON
833
+ @unittest .expectedFailure
802
834
def test_new_class_meta (self ):
803
835
Meta = self .Meta
804
836
settings = {"metaclass" : Meta , "z" : 2 }
@@ -809,6 +841,8 @@ def test_new_class_meta(self):
809
841
self .assertEqual (C .y , 1 )
810
842
self .assertEqual (C .z , 2 )
811
843
844
+ # TODO: RUSTPYTHON
845
+ @unittest .expectedFailure
812
846
def test_new_class_exec_body (self ):
813
847
Meta = self .Meta
814
848
def func (ns ):
@@ -834,6 +868,8 @@ def test_new_class_defaults(self):
834
868
self .assertEqual (C .__name__ , "C" )
835
869
self .assertEqual (C .__bases__ , (object ,))
836
870
871
+ # TODO: RUSTPYTHON
872
+ @unittest .expectedFailure
837
873
def test_new_class_meta_with_base (self ):
838
874
Meta = self .Meta
839
875
def func (ns ):
@@ -930,6 +966,8 @@ def __prepare__(*args):
930
966
self .assertIs (ns , expected_ns )
931
967
self .assertEqual (len (kwds ), 0 )
932
968
969
+ # TODO: RUSTPYTHON
970
+ @unittest .expectedFailure
933
971
def test_bad___prepare__ (self ):
934
972
# __prepare__() must return a mapping.
935
973
class BadMeta (type ):
@@ -974,6 +1012,8 @@ def __mro_entries__(self, bases):
974
1012
for bases in [x , y , z , t ]:
975
1013
self .assertIs (types .resolve_bases (bases ), bases )
976
1014
1015
+ # TODO: RUSTPYTHON
1016
+ @unittest .expectedFailure
977
1017
def test_metaclass_derivation (self ):
978
1018
# issue1294232: correct metaclass calculation
979
1019
new_calls = [] # to check the order of __new__ calls
@@ -1028,6 +1068,8 @@ def __prepare__(mcls, name, bases):
1028
1068
new_calls .clear ()
1029
1069
self .assertIn ('BMeta_was_here' , E .__dict__ )
1030
1070
1071
+ # TODO: RUSTPYTHON
1072
+ @unittest .expectedFailure
1031
1073
def test_metaclass_override_function (self ):
1032
1074
# Special case: the given metaclass isn't a class,
1033
1075
# so there is no metaclass calculation.
@@ -1129,6 +1171,8 @@ def __prepare__(mcls, name, bases):
1129
1171
with self .assertRaises (TypeError ):
1130
1172
X = types .new_class ("X" , (int (), C ))
1131
1173
1174
+ # TODO: RUSTPYTHON
1175
+ @unittest .expectedFailure
1132
1176
def test_one_argument_type (self ):
1133
1177
expected_message = 'type.__new__() takes exactly 3 arguments (1 given)'
1134
1178
@@ -1150,22 +1194,23 @@ class N(type, metaclass=M):
1150
1194
1151
1195
class SimpleNamespaceTests (unittest .TestCase ):
1152
1196
1153
- def test_constructor (self ):
1154
- ns1 = types .SimpleNamespace ()
1155
- ns2 = types .SimpleNamespace (x = 1 , y = 2 )
1156
- ns3 = types .SimpleNamespace (** dict (x = 1 , y = 2 ))
1197
+ # TODO: RUSTPYTHON
1198
+ # def test_constructor(self):
1199
+ # ns1 = types.SimpleNamespace()
1200
+ # ns2 = types.SimpleNamespace(x=1, y=2)
1201
+ # ns3 = types.SimpleNamespace(**dict(x=1, y=2))
1157
1202
1158
- with self .assertRaises (TypeError ):
1159
- types .SimpleNamespace (1 , 2 , 3 )
1160
- with self .assertRaises (TypeError ):
1161
- types .SimpleNamespace (** {1 : 2 })
1203
+ # with self.assertRaises(TypeError):
1204
+ # types.SimpleNamespace(1, 2, 3)
1205
+ # with self.assertRaises(TypeError):
1206
+ # types.SimpleNamespace(**{1: 2})
1162
1207
1163
- self .assertEqual (len (ns1 .__dict__ ), 0 )
1164
- self .assertEqual (vars (ns1 ), {})
1165
- self .assertEqual (len (ns2 .__dict__ ), 2 )
1166
- self .assertEqual (vars (ns2 ), {'y' : 2 , 'x' : 1 })
1167
- self .assertEqual (len (ns3 .__dict__ ), 2 )
1168
- self .assertEqual (vars (ns3 ), {'y' : 2 , 'x' : 1 })
1208
+ # self.assertEqual(len(ns1.__dict__), 0)
1209
+ # self.assertEqual(vars(ns1), {})
1210
+ # self.assertEqual(len(ns2.__dict__), 2)
1211
+ # self.assertEqual(vars(ns2), {'y': 2, 'x': 1})
1212
+ # self.assertEqual(len(ns3.__dict__), 2)
1213
+ # self.assertEqual(vars(ns3), {'y': 2, 'x': 1})
1169
1214
1170
1215
def test_unbound (self ):
1171
1216
ns1 = vars (types .SimpleNamespace ())
@@ -1205,6 +1250,8 @@ def test_attrset(self):
1205
1250
self .assertEqual (ns1 .__dict__ , dict (a = 'spam' , b = 'ham' ))
1206
1251
self .assertEqual (ns2 .__dict__ , dict (x = 1 , y = 2 , w = 3 , z = 4 , theta = None ))
1207
1252
1253
+ # TODO: RUSTPYTHON
1254
+ @unittest .expectedFailure
1208
1255
def test_attrdel (self ):
1209
1256
ns1 = types .SimpleNamespace ()
1210
1257
ns2 = types .SimpleNamespace (x = 1 , y = 2 , w = 3 )
@@ -1226,6 +1273,8 @@ def test_attrdel(self):
1226
1273
del ns1 .spam
1227
1274
self .assertEqual (vars (ns1 ), {})
1228
1275
1276
+ # TODO: RUSTPYTHON
1277
+ @unittest .expectedFailure
1229
1278
def test_repr (self ):
1230
1279
ns1 = types .SimpleNamespace (x = 1 , y = 2 , w = 3 )
1231
1280
ns2 = types .SimpleNamespace ()
@@ -1236,6 +1285,8 @@ def test_repr(self):
1236
1285
self .assertEqual (repr (ns1 ), "{name}(w=3, x=1, y=2)" .format (name = name ))
1237
1286
self .assertEqual (repr (ns2 ), "{name}(_y=5, x='spam')" .format (name = name ))
1238
1287
1288
+ # TODO: RUSTPYTHON
1289
+ @unittest .expectedFailure
1239
1290
def test_equal (self ):
1240
1291
ns1 = types .SimpleNamespace (x = 1 )
1241
1292
ns2 = types .SimpleNamespace ()
@@ -1274,6 +1325,8 @@ def test_recursive(self):
1274
1325
self .assertEqual (ns3 .spam , ns2 )
1275
1326
self .assertEqual (ns2 .spam .spam , ns2 )
1276
1327
1328
+ # TODO: RUSTPYTHON
1329
+ @unittest .expectedFailure
1277
1330
def test_recursive_repr (self ):
1278
1331
ns1 = types .SimpleNamespace (c = 'cookie' )
1279
1332
ns2 = types .SimpleNamespace ()
@@ -1309,6 +1362,8 @@ class Spam(types.SimpleNamespace):
1309
1362
self .assertIs (type (spam ), Spam )
1310
1363
self .assertEqual (vars (spam ), {'ham' : 8 , 'eggs' : 9 })
1311
1364
1365
+ # TODO: RUSTPYTHON
1366
+ @unittest .expectedFailure
1312
1367
def test_pickle (self ):
1313
1368
ns = types .SimpleNamespace (breakfast = "spam" , lunch = "spam" )
1314
1369
@@ -1366,6 +1421,8 @@ def foo():
1366
1421
foo = types .coroutine (foo )
1367
1422
self .assertIs (aw , foo ())
1368
1423
1424
+ # TODO: RUSTPYTHON
1425
+ @unittest .expectedFailure
1369
1426
def test_async_def (self ):
1370
1427
# Test that types.coroutine passes 'async def' coroutines
1371
1428
# without modification
@@ -1417,6 +1474,8 @@ def foo():
1417
1474
self .assertIs (foo (), coro )
1418
1475
self .assertIs (foo ().__await__ (), coro )
1419
1476
1477
+ # TODO: RUSTPYTHON
1478
+ @unittest .expectedFailure
1420
1479
def test_duck_gen (self ):
1421
1480
class GenLike :
1422
1481
def send (self ): pass
@@ -1573,6 +1632,8 @@ async def corofunc():
1573
1632
else :
1574
1633
self .fail ('StopIteration was expected' )
1575
1634
1635
+ # TODO: RUSTPYTHON
1636
+ @unittest .expectedFailure
1576
1637
def test_gen (self ):
1577
1638
def gen_func ():
1578
1639
yield 1
@@ -1622,6 +1683,8 @@ def foo():
1622
1683
foo = types .coroutine (foo )
1623
1684
self .assertIs (foo (), gencoro )
1624
1685
1686
+ # TODO: RUSTPYTHON
1687
+ @unittest .expectedFailure
1625
1688
def test_genfunc (self ):
1626
1689
def gen (): yield
1627
1690
self .assertIs (types .coroutine (gen ), gen )
0 commit comments