Commit cc482dfa authored by Raymond Hettinger's avatar Raymond Hettinger

Issue #26163: Disable periodically failing test which was overly demanding of...

Issue #26163:  Disable periodically failing test which was overly demanding of the frozenset hash function effectiveness
parent 22d93590
...@@ -730,9 +730,6 @@ class TestFrozenSet(TestJointOps, unittest.TestCase): ...@@ -730,9 +730,6 @@ class TestFrozenSet(TestJointOps, unittest.TestCase):
addhashvalue(hash(frozenset([e for e, m in elemmasks if m&i]))) addhashvalue(hash(frozenset([e for e, m in elemmasks if m&i])))
self.assertEqual(len(hashvalues), 2**n) self.assertEqual(len(hashvalues), 2**n)
def letter_range(n):
return string.ascii_letters[:n]
def zf_range(n): def zf_range(n):
# https://en.wikipedia.org/wiki/Set-theoretic_definition_of_natural_numbers # https://en.wikipedia.org/wiki/Set-theoretic_definition_of_natural_numbers
nums = [frozenset()] nums = [frozenset()]
...@@ -748,7 +745,7 @@ class TestFrozenSet(TestJointOps, unittest.TestCase): ...@@ -748,7 +745,7 @@ class TestFrozenSet(TestJointOps, unittest.TestCase):
for n in range(18): for n in range(18):
t = 2 ** n t = 2 ** n
mask = t - 1 mask = t - 1
for nums in (range, letter_range, zf_range): for nums in (range, zf_range):
u = len({h & mask for h in map(hash, powerset(nums(n)))}) u = len({h & mask for h in map(hash, powerset(nums(n)))})
self.assertGreater(4*u, t) self.assertGreater(4*u, t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment