summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-04-13 18:50:34 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-04-13 18:50:34 (GMT)
commitf400ab40e4eb7dc6ad886920fb02ce4f7d1e929f (patch)
tree2dac445eda2208fe82615298da4f84f30fbd8c37 /Lib/test
parentc6652ca468f7017fbfad15676b873919a9ee56dd (diff)
parent8a9c4d9866a29839e045bef51445085fe7938853 (diff)
downloadcpython-f400ab40e4eb7dc6ad886920fb02ce4f7d1e929f.zip
cpython-f400ab40e4eb7dc6ad886920fb02ce4f7d1e929f.tar.gz
cpython-f400ab40e4eb7dc6ad886920fb02ce4f7d1e929f.tar.bz2
merge
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_heapq.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index 3295869..b41458b 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -211,12 +211,6 @@ class TestHeapC(TestHeap):
self.assertEqual(hsort(data, LT), target)
self.assertRaises(TypeError, data, LE)
- # As an early adopter, we sanity check the
- # test.support.import_fresh_module utility function
- def test_accelerated(self):
- self.assertTrue(sys.modules['heapq'] is self.module)
- self.assertFalse(hasattr(self.module.heapify, '__code__'))
-
#==============================================================================
@@ -319,16 +313,16 @@ class TestErrorHandling(unittest.TestCase):
def test_non_sequence(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
for f in (self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10, 10)
def test_len_only(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, LenOnly())
+ self.assertRaises((TypeError, AttributeError), f, LenOnly())
for f in (self.module.heappush, self.module.heapreplace):
- self.assertRaises(TypeError, f, LenOnly(), 10)
+ self.assertRaises((TypeError, AttributeError), f, LenOnly(), 10)
for f in (self.module.nlargest, self.module.nsmallest):
self.assertRaises(TypeError, f, 2, LenOnly())
@@ -353,7 +347,7 @@ class TestErrorHandling(unittest.TestCase):
for f in (self.module.heapify, self.module.heappop,
self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
def test_iterable_args(self):
for f in (self.module.nlargest, self.module.nsmallest):