@@ -5698,15 +5698,18 @@ def test_joinable_queue(self):
5698
5698
5699
5699
@classmethod
5700
5700
def _test_list (cls , obj ):
5701
- assert obj [0 ] == 5
5702
- assert obj .count (5 ) == 1
5703
- assert obj .index (5 ) == 0
5701
+ def check (a , b ):
5702
+ if a != b :
5703
+ raise AssertionError (f"{ a } != { b } " )
5704
+ check (obj [0 ], 5 )
5705
+ check (obj .count (5 ), 1 )
5706
+ check (obj .index (5 ), 0 )
5704
5707
obj .sort ()
5705
5708
obj .reverse ()
5706
5709
for x in obj :
5707
5710
pass
5708
- assert len (obj ) == 1
5709
- assert obj .pop (0 ) == 5
5711
+ check ( len (obj ), 1 )
5712
+ check ( obj .pop (0 ), 5 )
5710
5713
5711
5714
def test_list (self ):
5712
5715
o = self .manager .list ()
@@ -5717,14 +5720,17 @@ def test_list(self):
5717
5720
5718
5721
@classmethod
5719
5722
def _test_dict (cls , obj ):
5720
- assert len (obj ) == 1
5721
- assert obj ['foo' ] == 5
5722
- assert obj .get ('foo' ) == 5
5723
- assert list (obj .items ()) == [('foo' , 5 )]
5724
- assert list (obj .keys ()) == ['foo' ]
5725
- assert list (obj .values ()) == [5 ]
5726
- assert obj .copy () == {'foo' : 5 }
5727
- assert obj .popitem () == ('foo' , 5 )
5723
+ def check (a , b ):
5724
+ if a != b :
5725
+ raise AssertionError (f"{ a } != { b } " )
5726
+ check (len (obj ), 1 )
5727
+ check (obj ['foo' ], 5 )
5728
+ check (obj .get ('foo' ), 5 )
5729
+ check (list (obj .items ()), [('foo' , 5 )])
5730
+ check (list (obj .keys ()), ['foo' ])
5731
+ check (list (obj .values ()), [5 ])
5732
+ check (obj .copy (), {'foo' : 5 })
5733
+ check (obj .popitem (), ('foo' , 5 ))
5728
5734
5729
5735
def test_dict (self ):
5730
5736
o = self .manager .dict ()
0 commit comments