Skip to content

Commit 1b9ba7c

Browse files
committed
mark failing tests of test_types.py
1 parent 41b6794 commit 1b9ba7c

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

Lib/test/test_types.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ def test_numeric_types(self):
8686
if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
8787
else: self.fail('float() does not work properly')
8888

89+
# TODO: RUSTPYTHON
90+
@unittest.expectedFailure
8991
def test_float_to_string(self):
9092
def test(f, result):
9193
self.assertEqual(f.__format__('e'), result)
@@ -206,6 +208,8 @@ def test_type_function(self):
206208
self.assertRaises(TypeError, type, 1, 2)
207209
self.assertRaises(TypeError, type, 1, 2, 3, 4)
208210

211+
# TODO: RUSTPYTHON
212+
@unittest.expectedFailure
209213
def test_int__format__(self):
210214
def test(i, format_spec, result):
211215
# just make sure we have the unified type for integers
@@ -375,6 +379,8 @@ def test(i, format_spec, result):
375379
test(123456, "1=20", '11111111111111123456')
376380
test(123456, "*=20", '**************123456')
377381

382+
# TODO: RUSTPYTHON
383+
@unittest.expectedFailure
378384
@run_with_locale('LC_NUMERIC', 'en_US.UTF8')
379385
def test_float__format__locale(self):
380386
# test locale support for __format__ code 'n'
@@ -384,6 +390,8 @@ def test_float__format__locale(self):
384390
self.assertEqual(locale.format_string('%g', x, grouping=True), format(x, 'n'))
385391
self.assertEqual(locale.format_string('%.10g', x, grouping=True), format(x, '.10n'))
386392

393+
# TODO: RUSTPYTHON
394+
@unittest.expectedFailure
387395
@run_with_locale('LC_NUMERIC', 'en_US.UTF8')
388396
def test_int__format__locale(self):
389397
# test locale support for __format__ code 'n' for integers
@@ -403,6 +411,8 @@ def test_int__format__locale(self):
403411
self.assertEqual(len(format(0, lfmt)), len(format(x, lfmt)))
404412
self.assertEqual(len(format(0, cfmt)), len(format(x, cfmt)))
405413

414+
# TODO: RUSTPYTHON
415+
@unittest.expectedFailure
406416
def test_float__format__(self):
407417
def test(f, format_spec, result):
408418
self.assertEqual(f.__format__(format_spec), result)
@@ -553,6 +563,7 @@ def test(f, format_spec, result):
553563
test(12345.6, "1=20", '111111111111112345.6')
554564
test(12345.6, "*=20", '*************12345.6')
555565

566+
@unittest.skip("TODO: RUSTPYTHON")
556567
def test_format_spec_errors(self):
557568
# int, float, and string all share the same format spec
558569
# mini-language parser.
@@ -572,6 +583,8 @@ def test_format_spec_errors(self):
572583
for code in 'xXobns':
573584
self.assertRaises(ValueError, format, 0, ',' + code)
574585

586+
# TODO: RUSTPYTHON
587+
@unittest.expectedFailure
575588
def test_internal_sizes(self):
576589
self.assertGreater(object.__basicsize__, 0)
577590
self.assertGreater(tuple.__itemsize__, 0)
@@ -588,6 +601,8 @@ def test_method_wrapper_types(self):
588601
self.assertIsInstance(object().__lt__, types.MethodWrapperType)
589602
self.assertIsInstance((42).__lt__, types.MethodWrapperType)
590603

604+
# TODO: RUSTPYTHON
605+
@unittest.expectedFailure
591606
def test_method_descriptor_types(self):
592607
self.assertIsInstance(str.join, types.MethodDescriptorType)
593608
self.assertIsInstance(list.append, types.MethodDescriptorType)
@@ -602,6 +617,8 @@ def test_method_descriptor_types(self):
602617
class MappingProxyTests(unittest.TestCase):
603618
mappingproxy = types.MappingProxyType
604619

620+
# TODO: RUSTPYTHON
621+
@unittest.expectedFailure
605622
def test_constructor(self):
606623
class userdict(dict):
607624
pass
@@ -617,6 +634,8 @@ class userdict(dict):
617634
self.assertRaises(TypeError, self.mappingproxy, ("a", "tuple"))
618635
self.assertRaises(TypeError, self.mappingproxy, ["a", "list"])
619636

637+
# TODO: RUSTPYTHON
638+
@unittest.expectedFailure
620639
def test_methods(self):
621640
attrs = set(dir(self.mappingproxy({}))) - set(dir(object()))
622641
self.assertEqual(attrs, {
@@ -640,6 +659,8 @@ def test_get(self):
640659
self.assertIsNone(view.get('xxx'))
641660
self.assertEqual(view.get('xxx', 42), 42)
642661

662+
# TODO: RUSTPYTHON
663+
@unittest.expectedFailure
643664
def test_missing(self):
644665
class dictmissing(dict):
645666
def __missing__(self, key):
@@ -654,6 +675,8 @@ def __missing__(self, key):
654675
self.assertTrue('x' in view)
655676
self.assertFalse('y' in view)
656677

678+
# TODO: RUSTPYTHON
679+
@unittest.expectedFailure
657680
def test_customdict(self):
658681
class customdict(dict):
659682
def __contains__(self, key):
@@ -702,6 +725,8 @@ def get(self, key, default=None):
702725
self.assertEqual(view.keys(), 'keys')
703726
self.assertEqual(view.values(), 'values')
704727

728+
# TODO: RUSTPYTHON
729+
@unittest.expectedFailure
705730
def test_chainmap(self):
706731
d1 = {'x': 1}
707732
d2 = {'y': 2}
@@ -747,6 +772,8 @@ def test_views(self):
747772
self.assertEqual(list(values), ['value'])
748773
self.assertEqual(list(items), [('key', 'value')])
749774

775+
# TODO: RUSTPYTHON
776+
@unittest.expectedFailure
750777
def test_len(self):
751778
for expected in range(6):
752779
data = dict.fromkeys('abcde'[:expected])
@@ -764,6 +791,8 @@ def test_iterators(self):
764791
self.assertEqual(set(view.values()), set(values))
765792
self.assertEqual(set(view.items()), set(items))
766793

794+
# TODO: RUSTPYTHON
795+
@unittest.expectedFailure
767796
def test_copy(self):
768797
original = {'key1': 27, 'key2': 51, 'key3': 93}
769798
view = self.mappingproxy(original)
@@ -799,6 +828,8 @@ def test_new_class_subclass(self):
799828
C = types.new_class("C", (int,))
800829
self.assertTrue(issubclass(C, int))
801830

831+
# TODO: RUSTPYTHON
832+
@unittest.expectedFailure
802833
def test_new_class_meta(self):
803834
Meta = self.Meta
804835
settings = {"metaclass": Meta, "z": 2}
@@ -809,6 +840,8 @@ def test_new_class_meta(self):
809840
self.assertEqual(C.y, 1)
810841
self.assertEqual(C.z, 2)
811842

843+
# TODO: RUSTPYTHON
844+
@unittest.expectedFailure
812845
def test_new_class_exec_body(self):
813846
Meta = self.Meta
814847
def func(ns):
@@ -834,6 +867,8 @@ def test_new_class_defaults(self):
834867
self.assertEqual(C.__name__, "C")
835868
self.assertEqual(C.__bases__, (object,))
836869

870+
# TODO: RUSTPYTHON
871+
@unittest.expectedFailure
837872
def test_new_class_meta_with_base(self):
838873
Meta = self.Meta
839874
def func(ns):
@@ -930,6 +965,8 @@ def __prepare__(*args):
930965
self.assertIs(ns, expected_ns)
931966
self.assertEqual(len(kwds), 0)
932967

968+
# TODO: RUSTPYTHON
969+
@unittest.expectedFailure
933970
def test_bad___prepare__(self):
934971
# __prepare__() must return a mapping.
935972
class BadMeta(type):
@@ -974,6 +1011,8 @@ def __mro_entries__(self, bases):
9741011
for bases in [x, y, z, t]:
9751012
self.assertIs(types.resolve_bases(bases), bases)
9761013

1014+
# TODO: RUSTPYTHON
1015+
@unittest.expectedFailure
9771016
def test_metaclass_derivation(self):
9781017
# issue1294232: correct metaclass calculation
9791018
new_calls = [] # to check the order of __new__ calls
@@ -1028,6 +1067,8 @@ def __prepare__(mcls, name, bases):
10281067
new_calls.clear()
10291068
self.assertIn('BMeta_was_here', E.__dict__)
10301069

1070+
# TODO: RUSTPYTHON
1071+
@unittest.expectedFailure
10311072
def test_metaclass_override_function(self):
10321073
# Special case: the given metaclass isn't a class,
10331074
# so there is no metaclass calculation.
@@ -1129,6 +1170,8 @@ def __prepare__(mcls, name, bases):
11291170
with self.assertRaises(TypeError):
11301171
X = types.new_class("X", (int(), C))
11311172

1173+
# TODO: RUSTPYTHON
1174+
@unittest.expectedFailure
11321175
def test_one_argument_type(self):
11331176
expected_message = 'type.__new__() takes exactly 3 arguments (1 given)'
11341177

@@ -1150,6 +1193,7 @@ class N(type, metaclass=M):
11501193

11511194
class SimpleNamespaceTests(unittest.TestCase):
11521195

1196+
@unittest.skip("TODO: RUSTPYTHON")
11531197
def test_constructor(self):
11541198
ns1 = types.SimpleNamespace()
11551199
ns2 = types.SimpleNamespace(x=1, y=2)
@@ -1205,6 +1249,8 @@ def test_attrset(self):
12051249
self.assertEqual(ns1.__dict__, dict(a='spam', b='ham'))
12061250
self.assertEqual(ns2.__dict__, dict(x=1, y=2, w=3, z=4, theta=None))
12071251

1252+
# TODO: RUSTPYTHON
1253+
@unittest.expectedFailure
12081254
def test_attrdel(self):
12091255
ns1 = types.SimpleNamespace()
12101256
ns2 = types.SimpleNamespace(x=1, y=2, w=3)
@@ -1226,6 +1272,8 @@ def test_attrdel(self):
12261272
del ns1.spam
12271273
self.assertEqual(vars(ns1), {})
12281274

1275+
# TODO: RUSTPYTHON
1276+
@unittest.expectedFailure
12291277
def test_repr(self):
12301278
ns1 = types.SimpleNamespace(x=1, y=2, w=3)
12311279
ns2 = types.SimpleNamespace()
@@ -1236,6 +1284,8 @@ def test_repr(self):
12361284
self.assertEqual(repr(ns1), "{name}(w=3, x=1, y=2)".format(name=name))
12371285
self.assertEqual(repr(ns2), "{name}(_y=5, x='spam')".format(name=name))
12381286

1287+
# TODO: RUSTPYTHON
1288+
@unittest.expectedFailure
12391289
def test_equal(self):
12401290
ns1 = types.SimpleNamespace(x=1)
12411291
ns2 = types.SimpleNamespace()
@@ -1274,6 +1324,8 @@ def test_recursive(self):
12741324
self.assertEqual(ns3.spam, ns2)
12751325
self.assertEqual(ns2.spam.spam, ns2)
12761326

1327+
# TODO: RUSTPYTHON
1328+
@unittest.expectedFailure
12771329
def test_recursive_repr(self):
12781330
ns1 = types.SimpleNamespace(c='cookie')
12791331
ns2 = types.SimpleNamespace()
@@ -1309,6 +1361,8 @@ class Spam(types.SimpleNamespace):
13091361
self.assertIs(type(spam), Spam)
13101362
self.assertEqual(vars(spam), {'ham': 8, 'eggs': 9})
13111363

1364+
# TODO: RUSTPYTHON
1365+
@unittest.expectedFailure
13121366
def test_pickle(self):
13131367
ns = types.SimpleNamespace(breakfast="spam", lunch="spam")
13141368

@@ -1366,6 +1420,8 @@ def foo():
13661420
foo = types.coroutine(foo)
13671421
self.assertIs(aw, foo())
13681422

1423+
# TODO: RUSTPYTHON
1424+
@unittest.expectedFailure
13691425
def test_async_def(self):
13701426
# Test that types.coroutine passes 'async def' coroutines
13711427
# without modification
@@ -1417,6 +1473,8 @@ def foo():
14171473
self.assertIs(foo(), coro)
14181474
self.assertIs(foo().__await__(), coro)
14191475

1476+
# TODO: RUSTPYTHON
1477+
@unittest.expectedFailure
14201478
def test_duck_gen(self):
14211479
class GenLike:
14221480
def send(self): pass
@@ -1573,6 +1631,8 @@ async def corofunc():
15731631
else:
15741632
self.fail('StopIteration was expected')
15751633

1634+
# TODO: RUSTPYTHON
1635+
@unittest.expectedFailure
15761636
def test_gen(self):
15771637
def gen_func():
15781638
yield 1
@@ -1622,6 +1682,8 @@ def foo():
16221682
foo = types.coroutine(foo)
16231683
self.assertIs(foo(), gencoro)
16241684

1685+
# TODO: RUSTPYTHON
1686+
@unittest.expectedFailure
16251687
def test_genfunc(self):
16261688
def gen(): yield
16271689
self.assertIs(types.coroutine(gen), gen)

0 commit comments

Comments
 (0)