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