mirror of
https://github.com/python/cpython.git
synced 2025-09-25 09:50:37 +00:00
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)
(cherry picked from commit 4101181fd8
)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
parent
7784d4bb15
commit
ef3ccd7370
1 changed files with 1 additions and 14 deletions
|
@ -280,11 +280,6 @@ class LenOnly:
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return 10
|
return 10
|
||||||
|
|
||||||
class GetOnly:
|
|
||||||
"Dummy sequence class defining __getitem__ but not __len__."
|
|
||||||
def __getitem__(self, ndx):
|
|
||||||
return 10
|
|
||||||
|
|
||||||
class CmpErr:
|
class CmpErr:
|
||||||
"Dummy element that always raises an error during comparison"
|
"Dummy element that always raises an error during comparison"
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
@ -396,15 +391,7 @@ class TestErrorHandling:
|
||||||
for f in (self.module.nlargest, self.module.nsmallest):
|
for f in (self.module.nlargest, self.module.nsmallest):
|
||||||
self.assertRaises(TypeError, f, 2, LenOnly())
|
self.assertRaises(TypeError, f, 2, LenOnly())
|
||||||
|
|
||||||
def test_get_only(self):
|
def test_cmp_err(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):
|
|
||||||
seq = [CmpErr(), CmpErr(), CmpErr()]
|
seq = [CmpErr(), CmpErr(), CmpErr()]
|
||||||
for f in (self.module.heapify, self.module.heappop):
|
for f in (self.module.heapify, self.module.heappop):
|
||||||
self.assertRaises(ZeroDivisionError, f, seq)
|
self.assertRaises(ZeroDivisionError, f, seq)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue