@@ -1279,6 +1279,8 @@ def __post_init__(self, init_param):
1279
1279
c = C (init_param = 10 )
1280
1280
self .assertEqual (c .x , 20 )
1281
1281
1282
+ # TODO: RUSTPYTHON
1283
+ @unittest .expectedFailure
1282
12
8000
84
def test_init_var_preserve_type (self ):
1283
1285
self .assertEqual (InitVar [int ].type , int )
1284
1286
@@ -1537,6 +1539,8 @@ class B:
1537
1539
with self .assertRaisesRegex (TypeError , 'should be called on dataclass instances' ):
1538
1540
replace (obj , x = 0 )
1539
1541
1542
+ # TODO: RUSTPYTHON
1543
+ @unittest .expectedFailure
1540
1544
def test_is_dataclass_genericalias (self ):
1541
1545
@dataclass
1542
1546
class A (types .GenericAlias ):
@@ -1775,6 +1779,8 @@ class C:
1775
1779
self .assertIsNot (d ['f' ], t )
1776
1780
self .assertEqual (d ['f' ].my_a (), 6 )
1777
1781
1782
+ # TODO: RUSTPYTHON
1783
+ @unittest .expectedFailure
1778
1784
def test_helper_asdict_defaultdict (self ):
1779
1785
# Ensure asdict() does not throw exceptions when a
1780
1786
# defaultdict is a member of a dataclass
@@ -1917,6 +1923,8 @@ class C:
1917
1923
t = astuple (c , tuple_factory = list )
1918
1924
self .assertEqual (t , ['outer' , T (1 , ['inner' , T (11 , 12 , 13 )], 2 )])
1919
1925
1926
+ # TODO: RUSTPYTHON
1927
+ @unittest .expectedFailure
1920
1928
def test_helper_astuple_defaultdict (self ):
1921
1929
# Ensure astuple() does not throw exceptions when a
1922
1930
# defaultdict is a member of a dataclass
@@ -2327,13 +2335,17 @@ class C:
2327
2335
2328
2336
self .assertDocStrEqual (C .__doc__ , "C(x:List[int]=<factory>)" )
2329
2337
2338
+ # TODO: RUSTPYTHON
2339
+ @unittest .expectedFailure
2330
2340
def test_docstring_deque_field (self ):
2331
2341
@dataclass
2332
2342
class C :
2333
2343
x : deque
2334
2344
2335
2345
self .assertDocStrEqual (C .__doc__ , "C(x:collections.deque)" )
2336
2346
2347
+ # TODO: RUSTPYTHON
2348
+ @unittest .expectedFailure
2337
2349
def test_docstring_deque_field_with_default_factory (self ):
2338
2350
@dataclass
2339
2351
class C :
@@ -3073,6 +3085,8 @@ class C:
3073
3085
3074
3086
3075
3087
class TestSlots (unittest .TestCase ):
3088
+ # TODO: RUSTPYTHON
3089
+ @unittest .expectedFailure
3076
3090
def test_simple (self ):
3077
3091
@dataclass
3078
3092
class C :
@@ -3114,6 +3128,8 @@ class Derived(Base):
3114
3128
# We can add a new field to the derived instance.
3115
3129
d .z = 10
3116
3130
3131
+ # TODO: RUSTPYTHON
3132
+ @unittest .expectedFailure
3117
3133
def test_generated_slots (self ):
3118
3134
@dataclass (slots = True )
3119
3135
class C :
@@ -3318,6 +3334,8 @@ class A:
3318
3334
self .assertEqual (obj .a , 'a' )
3319
3335
self .assertEqual (obj .b , 'b' )
3320
3336
3337
+ # TODO: RUSTPYTHON
3338
+ @unittest .expectedFailure
3321
3339
def test_slots_no_weakref (self ):
3322
3340
@dataclass (slots = True )
3323
3341
class A :
@@ -3332,6 +3350,8 @@ class A:
3332
3350
with self .assertRaises (AttributeError ):
3333
3351
a .__weakref__
3334
3352
3353
+ # TODO: RUSTPYTHON
3354
+ @unittest .expectedFailure
3335
3355
def test_slots_weakref (self ):
3336
3356
@dataclass (slots = True , weakref_slot = True )
3337
3357
class A :
@@ -3392,6 +3412,8 @@ def test_weakref_slot_make_dataclass(self):
3392
3412
"weakref_slot is True but slots is False" ):
3393
3413
B = make_dataclass ('B' , [('a' , int ),], weakref_slot = True )
3394
3414
3415
+ # TODO: RUSTPYTHON
3416
+ @unittest .expectedFailure
3395
3417
def test_weakref_slot_subclass_weakref_slot (self ):
3396
3418
@dataclass (slots = True , weakref_slot = True )
3397
3419
class Base :
@@ -3410,6 +3432,8 @@ class A(Base):
3410
3432
a_ref = weakref .ref (a )
3411
3433
self .assertIs (a .__weakref__ , a_ref )
3412
3434
3435
+ # TODO: RUSTPYTHON
3436
+ @unittest .expectedFailure
3413
3437
def test_weakref_slot_subclass_no_weakref_slot (self ):
3414
3438
@dataclass (slots = True , weakref_slot = True )
3415
3439
class Base :
@@ -3427,6 +3451,8 @@ class A(Base):
3427
3451
a_ref = weakref .ref (a )
3428
3452
self .assertIs (a .__weakref__ , a_ref )
3429
3453
3454
+ # TODO: RUSTPYTHON
3455
+ @unittest .expectedFailure
3430
3456
def test_weakref_slot_normal_base_weakref_slot (self ):
3431
3457
class Base :
3432
3458
__slots__ = ('__weakref__' ,)
@@ -3472,6 +3498,8 @@ class B[T2]:
3472
3498
self .assertTrue (B .__weakref__ )
3473
3499
B ()
3474
3500
3501
+ # TODO: RUSTPYTHON
3502
+ @unittest .expectedFailure
3475
3503
def test_dataclass_derived_generic_from_base (self ):
3476
3504
T = typing .TypeVar ('T' )
3477
3505
@@ -4513,6 +4541,8 @@ class C:
4513
4541
b : int = field (kw_only = True )
4514
4542
self .assertEqual (C (42 , b = 10 ).__match_args__ , ('a' ,))
4515
4543
4544
+ # TODO: RUSTPYTHON
4545
+ @unittest .expectedFailure
4516
4546
def test_KW_ONLY (self ):
4517
4547
@dataclass
4518
4548
class A :
0 commit comments