diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-08-08 05:43:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-08 05:43:18 (GMT) |
commit | 7d44e7a4563072d0fad00427b76b94cad61c38ae (patch) | |
tree | 3c5244b17e90529d6f10c8c54bfadf4caa31cb38 /Lib/test/test_contains.py | |
parent | 662db125cddbca1db68116c547c290eb3943d98e (diff) | |
download | cpython-7d44e7a4563072d0fad00427b76b94cad61c38ae.zip cpython-7d44e7a4563072d0fad00427b76b94cad61c38ae.tar.gz cpython-7d44e7a4563072d0fad00427b76b94cad61c38ae.tar.bz2 |
bpo-37685: Use singletons ALWAYS_EQ and NEVER_EQ in more tests. (GH-15167)
Diffstat (limited to 'Lib/test/test_contains.py')
-rw-r--r-- | Lib/test/test_contains.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/test/test_contains.py b/Lib/test/test_contains.py index 036a1d0..471d04a 100644 --- a/Lib/test/test_contains.py +++ b/Lib/test/test_contains.py @@ -1,5 +1,6 @@ from collections import deque import unittest +from test.support import NEVER_EQ class base_set: @@ -69,13 +70,7 @@ class TestContains(unittest.TestCase): # containment and equality tests involving elements that are # not necessarily equal to themselves - class MyNonReflexive(object): - def __eq__(self, other): - return False - def __hash__(self): - return 28 - - values = float('nan'), 1, None, 'abc', MyNonReflexive() + values = float('nan'), 1, None, 'abc', NEVER_EQ constructors = list, tuple, dict.fromkeys, set, frozenset, deque for constructor in constructors: container = constructor(values) |