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

Method test_method_bad_hash

Lib/test/test_functools.py:3430–3443  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3428 self.assertIs(b.t(2), b)
3429
3430 def test_method_bad_hash(self):
3431 class A:
3432 def __eq__(self, other):
3433 raise AssertionError
3434 def __hash__(self):
3435 raise AssertionError
3436 @functools.singledispatchmethod
3437 def t(self, arg):
3438 pass
3439
3440 # Should not raise
3441 A().t(1)
3442 hash(A().t)
3443 A().t == A().t
3444
3445 def test_method_no_reference_loops(self):
3446 # gh-127750: Created a strong reference to self

Callers

nothing calls this directly

Calls 3

hashFunction · 0.85
AClass · 0.70
tMethod · 0.45

Tested by

no test coverage detected