@@ -211,12 +211,6 @@ def __le__(self, other):
211211 self .assertEqual (hsort (data , LT ), target )
212212 self .assertRaises (TypeError , data , LE )
213213
214- # As an early adopter, we sanity check the
215- # test.support.import_fresh_module utility function
216- def test_accelerated (self ):
217- self .assertTrue (sys .modules ['heapq' ] is self .module )
218- self .assertFalse (hasattr (self .module .heapify , '__code__' ))
219-
220214
221215#==============================================================================
222216
@@ -319,16 +313,16 @@ class TestErrorHandling(unittest.TestCase):
319313
320314 def test_non_sequence (self ):
321315 for f in (self .module .heapify , self .module .heappop ):
322- self .assertRaises (TypeError , f , 10 )
316+ self .assertRaises (( TypeError , AttributeError ) , f , 10 )
323317 for f in (self .module .heappush , self .module .heapreplace ,
324318 self .module .nlargest , self .module .nsmallest ):
325- self .assertRaises (TypeError , f , 10 , 10 )
319+ self .assertRaises (( TypeError , AttributeError ) , f , 10 , 10 )
326320
327321 def test_len_only (self ):
328322 for f in (self .module .heapify , self .module .heappop ):
329- self .assertRaises (TypeError , f , LenOnly ())
323+ self .assertRaises (( TypeError , AttributeError ) , f , LenOnly ())
330324 for f in (self .module .heappush , self .module .heapreplace ):
331- self .assertRaises (TypeError , f , LenOnly (), 10 )
325+ self .assertRaises (( TypeError , AttributeError ) , f , LenOnly (), 10 )
332326 for f in (self .module .nlargest , self .module .nsmallest ):
333327 self .assertRaises (TypeError , f , 2 , LenOnly ())
334328
@@ -353,7 +347,7 @@ def test_arg_parsing(self):
353347 for f in (self .module .heapify , self .module .heappop ,
354348 self .module .heappush , self .module .heapreplace ,
355349 self .module .nlargest , self .module .nsmallest ):
356- self .assertRaises (TypeError , f , 10 )
350+ self .assertRaises (( TypeError , AttributeError ) , f , 10 )
357351
358352 def test_iterable_args (self ):
359353 for f in (self .module .nlargest , self .module .nsmallest ):
0 commit comments