bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)

This commit is contained in:
Serhiy Storchaka 2019-08-08 08:43:18 +03:00 committed by GitHub
parent 662db125cd
commit 7d44e7a456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 57 deletions

View file

@ -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,