@@ -56,7 +56,7 @@ def test_error(self):
5656 self .assertRaises (TypeError , slice (self .n ).indices , 0 )
5757
5858
59- class SeqTestCase ( unittest . TestCase ) :
59+ class SeqTestCase :
6060 # This test case isn't run directly. It just defines common tests
6161 # to the different sequence types below
6262 def setUp (self ):
@@ -126,7 +126,7 @@ def test_error(self):
126126 self .assertRaises (TypeError , sliceobj , self .n , self )
127127
128128
129- class ListTestCase (SeqTestCase ):
129+ class ListTestCase (SeqTestCase , unittest . TestCase ):
130130 seq = [0 ,10 ,20 ,30 ,40 ,50 ]
131131
132132 def test_setdelitem (self ):
@@ -182,19 +182,19 @@ def __getitem__(self, index):
182182 return self ._list [index ]
183183
184184
185- class TupleTestCase (SeqTestCase ):
185+ class TupleTestCase (SeqTestCase , unittest . TestCase ):
186186 seq = (0 ,10 ,20 ,30 ,40 ,50 )
187187
188- class ByteArrayTestCase (SeqTestCase ):
188+ class ByteArrayTestCase (SeqTestCase , unittest . TestCase ):
189189 seq = bytearray (b"this is a test" )
190190
191- class BytesTestCase (SeqTestCase ):
191+ class BytesTestCase (SeqTestCase , unittest . TestCase ):
192192 seq = b"this is a test"
193193
194- class StringTestCase (SeqTestCase ):
194+ class StringTestCase (SeqTestCase , unittest . TestCase ):
195195 seq = "this is a test"
196196
197- class NewSeqTestCase (SeqTestCase ):
197+ class NewSeqTestCase (SeqTestCase , unittest . TestCase ):
198198 seq = NewSeq ((0 ,10 ,20 ,30 ,40 ,50 ))
199199
200200
@@ -237,18 +237,5 @@ def test_sequence_repeat(self):
237237 self .assertRaises (OverflowError , lambda : "a" * self .neg )
238238
239239
240- def test_main ():
241- support .run_unittest (
242- BaseTestCase ,
243- ListTestCase ,
244- TupleTestCase ,
245- BytesTestCase ,
246- ByteArrayTestCase ,
247- StringTestCase ,
248- NewSeqTestCase ,
249- RangeTestCase ,
250- OverflowTestCase ,
251- )
252-
253240if __name__ == "__main__" :
254- test_main ()
241+ unittest . main ()
0 commit comments