mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)
This commit is contained in:
parent
662db125cd
commit
7d44e7a456
9 changed files with 30 additions and 57 deletions
|
@ -1472,9 +1472,6 @@ class TestCollectionABCs(ABCTestCase):
|
|||
|
||||
def test_issue26915(self):
|
||||
# Container membership test should check identity first
|
||||
class CustomEqualObject:
|
||||
def __eq__(self, other):
|
||||
return False
|
||||
class CustomSequence(Sequence):
|
||||
def __init__(self, seq):
|
||||
self._seq = seq
|
||||
|
@ -1484,7 +1481,7 @@ class TestCollectionABCs(ABCTestCase):
|
|||
return len(self._seq)
|
||||
|
||||
nan = float('nan')
|
||||
obj = CustomEqualObject()
|
||||
obj = support.NEVER_EQ
|
||||
seq = CustomSequence([nan, obj, nan])
|
||||
containers = [
|
||||
seq,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue