summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_heapq.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-24 05:54:07 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-24 05:54:07 (GMT)
commitef3ccd737020a0bb49ea0bfe48069f89bb5370a1 (patch)
tree61812edb8c9afe7022086e3bb1ff9823dcc157a5 /Lib/test/test_heapq.py
parent7784d4bb155f0f527301b29f29b5469ba8a7b5d4 (diff)
downloadcpython-ef3ccd737020a0bb49ea0bfe48069f89bb5370a1.zip
cpython-ef3ccd737020a0bb49ea0bfe48069f89bb5370a1.tar.gz
cpython-ef3ccd737020a0bb49ea0bfe48069f89bb5370a1.tar.bz2
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)
(cherry picked from commit 4101181fd87c2fab6456663d3c8cc99377cf0463) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_heapq.py')
-rw-r--r--Lib/test/test_heapq.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index 6c20b62..861ba75 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -280,11 +280,6 @@ class LenOnly:
def __len__(self):
return 10
-class GetOnly:
- "Dummy sequence class defining __getitem__ but not __len__."
- def __getitem__(self, ndx):
- return 10
-
class CmpErr:
"Dummy element that always raises an error during comparison"
def __eq__(self, other):
@@ -396,15 +391,7 @@ class TestErrorHandling:
for f in (self.module.nlargest, self.module.nsmallest):
self.assertRaises(TypeError, f, 2, LenOnly())
- def test_get_only(self):
- for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, GetOnly())
- for f in (self.module.heappush, self.module.heapreplace):
- self.assertRaises(TypeError, f, GetOnly(), 10)
- for f in (self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 2, GetOnly())
-
- def test_get_only(self):
+ def test_cmp_err(self):
seq = [CmpErr(), CmpErr(), CmpErr()]
for f in (self.module.heapify, self.module.heappop):
self.assertRaises(ZeroDivisionError, f, seq)