@@ -374,7 +374,6 @@ def test_alias(self):
374
374
375
375
class TypeVarTests (BaseTestCase ):
376
376
# TODO: RUSTPYTHON
377
- @unittest .expectedFailure
378
377
def test_basic_plain (self ):
379
378
T = TypeVar ('T' )
380
379
# T equals itself.
@@ -405,7 +404,6 @@ def test_basic_with_exec(self):
405
404
self .assertIs (T .__module__ , None )
406
405
407
406
# TODO: RUSTPYTHON
408
- @unittest .expectedFailure
409
407
def test_attributes (self ):
410
408
T_bound = TypeVar ('T_bound' , bound = int )
411
409
self .assertEqual (T_bound .__name__ , 'T_bound' )
@@ -448,14 +446,11 @@ def test_typevar_subclass_type_error(self):
448
446
issubclass (T , int )
449
447
450
448
# TODO: RUSTPYTHON
451
- @unittest .expectedFailure
452
449
def test_constrained_error (self ):
453
450
with self .assertRaises (TypeError ):
454
451
X = TypeVar ('X' , int )
455
452
X
456
453
457
- # TODO: RUSTPYTHON
458
- @unittest .expectedFailure
459
454
def test_union_unique (self ):
460
455
X = TypeVar ('X' )
461
456
Y = TypeVar ('Y' )
@@ -486,7 +481,6 @@ def test_union_constrained(self):
486
481
self .assertNotEqual (Union [A , str ], Union [A ])
487
482
488
483
# TODO: RUSTPYTHON
489
- @unittest .expectedFailure
490
484
def test_repr (self ):
491
485
self .assertEqual (repr (T ), '~T' )
492
486
self .assertEqual (repr (KT ), '~KT' )
@@ -502,7 +496,6 @@ def test_no_redefinition(self):
502
496
self .assertNotEqual (TypeVar ('T' , int , str ), TypeVar ('T' , int , str ))
503
497
504
498
# TODO: RUSTPYTHON
505
- @unittest .expectedFailure
506
499
def test_cannot_subclass (self ):
507
500
with self .assertRaisesRegex (TypeError , NOT_A_BASE_TYPE % 'TypeVar' ):
508
501
class V (TypeVar ): pass
@@ -515,8 +508,6 @@ def test_cannot_instantiate_vars(self):
515
508
with self .assertRaises (TypeError ):
516
509
TypeVar ('A' )()
517
510
518
- # TODO: RUSTPYTHON
519
- @unittest .expectedFailure
520
511
def test_bound_errors (self ):
521
512
with self .assertRaises (TypeError ):
522
513
TypeVar ('X' , bound = Union )
@@ -533,22 +524,16 @@ def test_missing__name__(self):
533
524
)
534
525
exec (code , {})
535
526
536
- # TODO: RUSTPYTHON
537
- @unittest .expectedFailure
538
527
def test_no_bivariant (self ):
539
528
with self .assertRaises (ValueError ):
540
529
TypeVar ('T' , covariant = True , contravariant = True )
541
530
542
- # TODO: RUSTPYTHON
543
- @unittest .expectedFailure
544
531
def test_cannot_combine_explicit_and_infer (self ):
545
532
with self .assertRaises (ValueError ):
546
533
TypeVar ('T' , covariant = True , infer_variance = True )
547
534
with self .assertRaises (ValueError ):
548
535
TypeVar ('T' , contravariant = True , infer_variance = True )
549
536
550
- # TODO: RUSTPYTHON
551
- @unittest .expectedFailure
552
537
def test_var_substitution (self ):
553
538
T = TypeVar ('T' )
554
539
subst = T .__typing_subst__
@@ -591,7 +576,6 @@ def test_many_weakrefs(self):
591
576
del vals
592
577
593
578
# TODO: RUSTPYTHON
594
- @unittest .expectedFailure
595
579
def test_constructor (self ):
596
580
T = TypeVar (name = "T" )
597
581
self .assertEqual (T .__name__ , "T" )
@@ -648,8 +632,6 @@ def test_constructor(self):
648
632
self .assertIs (T .__infer_variance__ , True )
649
633
650
634
class TypeParameterDefaultsTests (BaseTestCase ):
651
- # TODO: RUSTPYTHON
652
- @unittest .expectedFailure
653
635
def test_typevar (self ):
654
636
T = TypeVar ('T' , default = int )
655
637
self .assertEqual (T .__default__ , int )
@@ -844,8 +826,6 @@ class A(Generic[T, U, DefaultStrT]): ...
844
826
):
845
827
Test = A [int ]
846
828
847
- # TODO: RUSTPYTHON
848
- @unittest .expectedFailure
849
829
def test_pickle (self ):
850
830
global U , U_co , U_contra , U_default # pickle wants to reference the class by name
851
831
U = TypeVar ('U' )
@@ -3695,8 +3675,6 @@ def test_repr(self):
3695
3675
self .assertEqual (repr (MySimpleMapping ),
3696
3676
f"<class '{ __name__ } .MySimpleMapping'>" )
3697
3677
3698
- # TODO: RUSTPYTHON
3699
- @unittest .expectedFailure
3700
3678
def test_chain_repr (self ):
3701
3679
T = TypeVar ('T' )
3702
3680
S = TypeVar ('S' )
@@ -3721,8 +3699,6 @@ class C(Generic[T]):
3721
3699
self .assertTrue (str (Z ).endswith (
3722
3700
'.C[typing.Tuple[str, int]]' ))
3723
3701
3724
- # TODO: RUSTPYTHON
3725
- @unittest .expectedFailure
3726
3702
def test_new_repr (self ):
3727
3703
T = TypeVar ('T' )
3728
3704
U = TypeVar ('U' , covariant = True )
@@ -3734,8 +3710,6 @@ def test_new_repr(self):
3734
3710
self .assertEqual (repr (List [S ][T ][int ]), 'typing.List[int]' )
3735
3711
self .assertEqual (repr (List [int ]), 'typing.List[int]' )
3736
3712
3737
- # TODO: RUSTPYTHON
3738
- @unittest .expectedFailure
3739
3713
def test_new_repr_complex (self ):
3740
3714
T = TypeVar ('T' )
3741
3715
TS = TypeVar ('TS' )
@@ -3862,8 +3836,6 @@ def test_orig_bases(self):
3862
3836
class C (typing .Dict [str , T ]): ...
3863
3837
self .assertEqual (C .__orig_bases__ , (typing .Dict [str , T ],))
3864
3838
3865
- # TODO: RUSTPYTHON
3866
- @unittest .expectedFailure
3867
3839
def test_naive_runtime_checks (self ):
3868
3840
def naive_dict_check (obj , tp ):
3869
3841
# Check if a dictionary conforms to Dict type
@@ -3919,8 +3891,6 @@ class D(C, List[T][U][V]): ...
3919
3891
self .assertEqual (C .__orig_bases__ , (List [T ][U ][V ],))
3920
3892
self .assertEqual (D .__orig_bases__ , (C , List [T ][U ][V ]))
3921
3893
3922
- # TODO: RUSTPYTHON
3923
- @unittest .expectedFailure
3924
3894
def test_subscript_meta (self ):
3925
3895
T = TypeVar ('T' )
3926
3896
class Meta (type ): ...
@@ -3972,8 +3942,6 @@ class A(Generic[T]):
3972
3942
self .assertTrue (repr (Tuple [mod_generics_cache .B .A [str ]])
3973
3943
.endswith ('mod_generics_cache.B.A[str]]' ))
3974
3944
3975
- # TODO: RUSTPYTHON
3976
- @unittest .expectedFailure
3977
3945
def test_extended_generic_rules_eq (self ):
3978
3946
T = TypeVar ('T' )
3979
3947
U = TypeVar ('U' )
@@ -3990,8 +3958,6 @@ class Derived(Base): ...
3990
3958
self .assertEqual (Callable [[T ], T ][KT ], Callable [[KT ], KT ])
3991
3959
self .assertEqual (Callable [..., List [T ]][int ], Callable [..., List [int ]])
3992
3960
3993
- # TODO: RUSTPYTHON
3994
- @unittest .expectedFailure
3995
3961
def test_extended_generic_rules_repr (self ):
3996
3962
T = TypeVar ('T' )
3997
3963
self .assertEqual (repr (Union [Tuple , Callable ]).replace ('typing.' , '' ),
@@ -4298,8 +4264,6 @@ class C(B[int]):
4298
4264
)
4299
4265
del PP
4300
4266
4301
- # TODO: RUSTPYTHON
4302
- @unittest .expectedFailure
4303
4267
def test_copy_and_deepcopy (self ):
4304
4268
T = TypeVar ('T' )
4305
4269
class Node (Generic [T ]): ...
@@ -8419,8 +8383,6 @@ def test_order_in_union(self):
8419
8383
with self .subTest (args = args ):
8420
8384
self .assertEqual (expr2 , Union [args ])
8421
8385
8422
- # TODO: RUSTPYTHON
8423
- @unittest .expectedFailure
8424
8386
def test_specialize (self ):
8425
8387
L = Annotated [List [T ], "my decoration" ]
8426
8388
LI = Annotated [List [int ], "my decoration" ]
@@ -8471,8 +8433,6 @@ def __eq__(self, other):
8471
8433
self .assertEqual (a .x , c .x )
8472
8434
self .assertEqual (a .classvar , c .classvar )
8473
8435
8474
- # TODO: RUSTPYTHON
8475
- @unittest .expectedFailure
8476
8436
def test_instantiate_generic (self ):
8477
8437
MyCount = Annotated [typing .Counter [T ], "my decoration" ]
8478
8438
self .assertEqual (MyCount ([4 , 4 , 5 ]), {4 : 2 , 5 : 1 })
@@ -8601,8 +8561,6 @@ class _Annotated_test_G(Generic[T]):
8601
8561
self .assertEqual (x .bar , 'abc' )
8602
8562
self .assertEqual (x .x , 1 )
8603
8563
8604
- # TODO: RUSTPYTHON
8605
- @unittest .expectedFailure
8606
8564
def test_subst (self ):
8607
8565
dec = "a decoration"
8608
8566
dec2 = "another decoration"
@@ -8748,8 +8706,6 @@ def test_typevar_subst(self):
8748
8706
with self .assertRaises (TypeError ):
8749
8707
J [int ]
8750
8708
8751
- # TODO: RUSTPYTHON
8752
- @unittest .expectedFailure
8753
8709
def test_annotated_in_other_types (self ):
8754
8710
X = List [Annotated [T , 5 ]]
8755
8711
self .assertEqual (X [int ], List [Annotated [int , 5 ]])
0 commit comments