Commit c1ac194e authored by Raymond Hettinger's avatar Raymond Hettinger

Clarify and speedup test.

parent babc83a2
......@@ -774,8 +774,9 @@ def _test_sample(n):
population = xrange(n)
for k in xrange(n+1):
s = sample(population, k)
assert len(dict([(elem,True) for elem in s])) == len(s) == k
assert None not in s
uniq = dict.fromkeys(s)
assert len(uniq) == len(s) == k
assert None not in uniq
def _sample_generator(n, k):
# Return a fixed element from the sample. Validates random ordering.
......
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