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

Method test_null_hash

Lib/test/test_hash.py:266–274  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

264 return self.known_hashes[algorithm][position][platform]
265
266 def test_null_hash(self):
267 # PYTHONHASHSEED=0 disables the randomized hash
268 known_hash_of_obj = self.get_expected_hash(0, 3)
269
270 # Randomization is enabled by default:
271 self.assertNotEqual(self.get_hash(self.repr_), known_hash_of_obj)
272
273 # It can also be disabled by setting the seed to 0:
274 self.assertEqual(self.get_hash(self.repr_, seed=0), known_hash_of_obj)
275
276 @skip_unless_internalhash
277 def test_fixed_hash(self):

Callers

nothing calls this directly

Calls 4

get_expected_hashMethod · 0.95
assertNotEqualMethod · 0.80
get_hashMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected