mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_contains from CPython 3.10.5
This commit is contained in:
1 parent
45e6fb14c2
commit
8a6fc05893
1 file changed
+2
-7
Vendored
+2
-7
@@ -1,5 +1,6 @@
|
||||
from collections import deque
|
||||
import unittest
|
||||
from test.support import NEVER_EQ
|
||||
|
||||
|
||||
class base_set:
|
||||
@@ -70,13 +71,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)
|
||||
|
||||
Reference in new issue
Block a user