MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_subclass_with_custom_hash

Method test_subclass_with_custom_hash

Lib/test/test_set.py:299–310  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

297 elem.set = set([elem])
298
299 def test_subclass_with_custom_hash(self):
300 # Bug #1257731
301 class H(self.thetype):
302 def __hash__(self):
303 return int(id(self) & 0x7fffffff)
304 s=H()
305 f=set()
306 f.add(s)
307 self.assertIn(s, f)
308 f.remove(s)
309 f.add(s)
310 f.discard(s)
311
312 def test_badcmp(self):
313 s = self.thetype([BadCmp()])

Callers

nothing calls this directly

Calls 6

setFunction · 0.85
assertInMethod · 0.80
HClass · 0.70
addMethod · 0.45
removeMethod · 0.45
discardMethod · 0.45

Tested by

no test coverage detected