MCPcopy Index your code
hub / github.com/python/cpython / test_hash

Method test_hash

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

Source from the content-addressed store, hash-verified

1226 [0, 1, 1, 2, 3, 4, 5, 7, 10])
1227
1228 def test_hash(self):
1229 def mycmp(x, y):
1230 return y - x
1231 key = self.cmp_to_key(mycmp)
1232 k = key(10)
1233 self.assertRaises(TypeError, hash, k)
1234 self.assertNotIsInstance(k, collections.abc.Hashable)
1235
1236 @unittest.skipIf(support.MISSING_C_DOCSTRINGS,
1237 "Signature information for builtins requires docstrings")

Callers

nothing calls this directly

Calls 2

assertNotIsInstanceMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected