@@ -1605,8 +1605,6 @@ class D(Generic[Unpack[Ts]]): pass
1605
1605
self .assertIs (D [T ].__origin__ , D )
1606
1606
self .assertIs (D [Unpack [Ts ]].__origin__ , D )
1607
1607
1608
- # TODO: RUSTPYTHON
1609
- @unittest .expectedFailure
1610
1608
def test_get_type_hints_on_unpack_args (self ):
1611
1609
Ts = TypeVarTuple ('Ts' )
1612
1610
@@ -1809,8 +1807,6 @@ class F(Generic[Unpack[Ts], T1, T2]): pass
1809
1807
F [int , str , float ]
1810
1808
F [int , str , float , bool ]
1811
1809
1812
- # TODO: RUSTPYTHON
1813
- @unittest .expectedFailure
1814
1810
def test_variadic_args_annotations_are_correct (self ):
1815
1811
Ts = TypeVarTuple ('Ts' )
1816
1812
@@ -3859,8 +3855,6 @@ def barfoo(x: AT): ...
3859
3855
def barfoo2 (x : CT ): ...
3860
3856
self .assertIs (get_type_hints (barfoo2 , globals (), locals ())['x' ], CT )
3861
3857
3862
- # TODO: RUSTPYTHON
3863
- @unittest .expectedFailure
3864
3858
def test_generic_pep585_forward_ref (self ):
3865
3859
# See https://bugs.python.org/issue41370
3866
3860
@@ -5189,8 +5183,6 @@ def cmp(o1, o2):
5189
5183
self .assertIsNot (r1 , r2 )
5190
5184
self .assertRaises (RecursionError , cmp , r1 , r2 )
5191
5185
5192
- # TODO: RUSTPYTHON
5193
- @unittest .expectedFailure
5194
5186
def test_union_forward_recursion (self ):
5195
5187
ValueList = List ['Value' ]
5196
5188
Value = Union [str , ValueList ]
@@ -5239,8 +5231,6 @@ def foo(a: 'Callable[..., T]'):
5239
5231
self .assertEqual (get_type_hints (foo , globals (), locals ()),
5240
5232
{'a' : Callable [..., T ]})
5241
5233
5242
- # TODO: RUSTPYTHON
5243
- @unittest .expectedFailure
5244
5234
def test_special_forms_forward (self ):
5245
5235
5246
5236
class C :
@@ -5323,8 +5313,6 @@ def foo(self, x: int): ...
5323
5313
5324
5314
self .assertEqual (get_type_hints (Child .foo ), {'x' : int })
5325
5315
5326
- # TODO: RUSTPYTHON
5327
- @unittest .expectedFailure
5328
5316
def test_no_type_check_nested_types (self ):
5329
5317
# See https://bugs.python.org/issue46571
5330
5318
class Other :
@@ -5409,8 +5397,6 @@ def test_no_type_check_TypeError(self):
5409
5397
# `TypeError: can't set attributes of built-in/extension type 'dict'`
5410
5398
no_type_check (dict )
5411
5399
5412
- # TODO: RUSTPYTHON
5413
- @unittest .expectedFailure
5414
5400
def test_no_type_check_forward_ref_as_string (self ):
5415
5401
class C :
5416
5402
foo : typing .ClassVar [int ] = 7
@@ -5465,8 +5451,6 @@ def test_default_globals(self):
5465
5451
hints = get_type_hints (ns ['C' ].foo )
5466
5452
self .assertEqual (hints , {'a' : ns ['C' ], 'return' : ns ['D' ]})
5467
5453
5468
- # TODO: RUSTPYTHON
5469
- @unittest .expectedFailure
5470
5454
def test_final_forward_ref (self ):
5471
5455
self .assertEqual (gth (Loop , globals ())['attr' ], Final [Loop ])
5472
5456
self .assertNotEqual (gth (Loop , globals ())['attr' ], Final [int ])
@@ -5832,8 +5816,6 @@ def test_get_type_hints_classes(self):
5832
5816
'my_inner_a2' : mod_generics_cache .B .A ,
5833
5817
'my_outer_a' : mod_generics_cache .A })
5834
5818
5835
- # TODO: RUSTPYTHON
5836
- @unittest .expectedFailure
5837
5819
def test_get_type_hints_classes_no_implicit_optional (self ):
5838
5820
class WithNoneDefault :
5839
5821
field : int = None # most type-checkers won't be happy with it
@@ -5878,8 +5860,6 @@ class B: ...
5878
5860
b .__annotations__ = {'x' : 'A' }
5879
5861
self .assertEqual (gth (b , locals ()), {'x' : A })
5880
5862
5881
- # TODO: RUSTPYTHON
5882
- @unittest .expectedFailure
5883
5863
def test_get_type_hints_ClassVar (self ):
5884
5864
self .assertEqual (gth (ann_module2 .CV , ann_module2 .__dict__ ),
5885
5865
{'var' : typing .ClassVar [ann_module2 .CV ]})
@@ -6006,8 +5986,6 @@ def annotated_with_none_default(x: Annotated[int, 'data'] = None): ...
6006
5986
{'x' : Annotated [int , 'data' ]},
6007
5987
)
6008
5988
6009
- # TODO: RUSTPYTHON
6010
- @unittest .expectedFailure
6011
5989
def test_get_type_hints_classes_str_annotations (self ):
6012
5990
class Foo :
6013
5991
y = str
@@ -6023,8 +6001,6 @@ class BadModule:
6023
6001
self .assertNotIn ('bad' , sys .modules )
6024
6002
self .assertEqual (get_type_hints (BadModule ), {})
6025
6003
6026
- # TODO: RUSTPYTHON
6027
- @unittest .expectedFailure
6028
6004
def test_get_type_hints_annotated_bad_module (self ):
6029
6005
# See https://bugs.python.org/issue44468
6030
6006
class BadBase :
@@ -6035,8 +6011,6 @@ class BadType(BadBase):
6035
6011
self .assertNotIn ('bad' , sys .modules )
6036
6012
self .assertEqual (get_type_hints (BadType ), {'foo' : tuple , 'bar' : list })
6037
6013
6038
- # TODO: RUSTPYTHON
6039
- @unittest .expectedFailure
6040
6014
def test_forward_ref_and_final (self ):
6041
6015
# https://bugs.python.org/issue45166
6042
6016
hints = get_type_hints (ann_module5 )
@@ -8274,8 +8248,6 @@ class C:
8274
8248
A .x = 5
8275
8249
self .assertEqual (C .x , 5 )
8276
8250
8277
- # TODO: RUSTPYTHON
8278
- @unittest .expectedFailure
8279
8251
def test_special_form_containment (self ):
8280
8252
class C :
8281
8253
classvar : Annotated [ClassVar [int ], "a decoration" ] = 4
@@ -8284,8 +8256,6 @@ class C:
8284
8256
self .assertEqual (get_type_hints (C , globals ())['classvar' ], ClassVar [int ])
8285
8257
self .assertEqual (get_type_hints (C , globals ())['const' ], Final [int ])
8286
8258
8287
- # TODO: RUSTPYTHON
8288
- @unittest .expectedFailure
8289
8259
def test_special_forms_nesting (self ):
8290
8260
# These are uncommon types and are to ensure runtime
8291
8261
# is lax on validation. See gh-89547 for more context.
@@ -8563,8 +8533,6 @@ def test_no_isinstance(self):
8563
8533
with self .assertRaises (TypeError ):
8564
8534
isinstance (42 , TypeAlias )
8565
8535
8566
- # TODO: RUSTPYTHON
8567
- @unittest .expectedFailure
8568
8536
def test_stringized_usage (self ):
8569
8537
class A :
8570
8538
a : "TypeAlias"
@@ -8652,8 +8620,6 @@ def test_args_kwargs(self):
8652
8620
self .assertEqual (repr (P .kwargs ), "P.kwargs" )
8653
8621
8654
8622
8655
- # TODO: RUSTPYTHON
8656
- @unittest .expectedFailure
8657
8623
def test_stringized (self ):
8658
8624
P = ParamSpec ('P' )
8659
8625
class C (Generic [P ]):
0 commit comments