@@ -38,7 +38,7 @@ def __index__(self):
3838 return self .value
3939
4040
41- class BaseBytesTest ( unittest . TestCase ) :
41+ class BaseBytesTest :
4242
4343 def test_basics (self ):
4444 b = self .type2test ()
@@ -682,7 +682,7 @@ def test_find_etc_raise_correct_error_messages(self):
682682 x , None , None , None )
683683
684684
685- class BytesTest (BaseBytesTest ):
685+ class BytesTest (BaseBytesTest , unittest . TestCase ):
686686 type2test = bytes
687687
688688 def test_buffer_is_readonly (self ):
@@ -730,7 +730,7 @@ def test_from_format(self):
730730 b's:cstr' )
731731
732732
733- class ByteArrayTest (BaseBytesTest ):
733+ class ByteArrayTest (BaseBytesTest , unittest . TestCase ):
734734 type2test = bytearray
735735
736736 def test_nohash (self ):
@@ -1293,16 +1293,16 @@ def test_upper(self):
12931293 def test_lower (self ):
12941294 pass
12951295
1296- class ByteArrayAsStringTest (FixedStringTest ):
1296+ class ByteArrayAsStringTest (FixedStringTest , unittest . TestCase ):
12971297 type2test = bytearray
12981298 contains_bytes = True
12991299
1300- class BytesAsStringTest (FixedStringTest ):
1300+ class BytesAsStringTest (FixedStringTest , unittest . TestCase ):
13011301 type2test = bytes
13021302 contains_bytes = True
13031303
13041304
1305- class SubclassTest ( unittest . TestCase ) :
1305+ class SubclassTest :
13061306
13071307 def test_basic (self ):
13081308 self .assertTrue (issubclass (self .subclass2test , self .type2test ))
@@ -1374,7 +1374,7 @@ class ByteArraySubclass(bytearray):
13741374class BytesSubclass (bytes ):
13751375 pass
13761376
1377- class ByteArraySubclassTest (SubclassTest ):
1377+ class ByteArraySubclassTest (SubclassTest , unittest . TestCase ):
13781378 type2test = bytearray
13791379 subclass2test = ByteArraySubclass
13801380
@@ -1389,16 +1389,10 @@ def __init__(me, newarg=1, *args, **kwargs):
13891389 self .assertEqual (x , b"abcd" )
13901390
13911391
1392- class BytesSubclassTest (SubclassTest ):
1392+ class BytesSubclassTest (SubclassTest , unittest . TestCase ):
13931393 type2test = bytes
13941394 subclass2test = BytesSubclass
13951395
13961396
1397- def test_main ():
1398- test .support .run_unittest (
1399- BytesTest , AssortedBytesTest , BytesAsStringTest ,
1400- ByteArrayTest , ByteArrayAsStringTest , BytesSubclassTest ,
1401- ByteArraySubclassTest , BytearrayPEP3137Test )
1402-
14031397if __name__ == "__main__" :
1404- test_main ()
1398+ unittest . main ()
0 commit comments