diff options
author | Raymond Hettinger <python@rcn.com> | 2003-01-17 17:23:23 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-01-17 17:23:23 (GMT) |
commit | 7b0cf76b72a499c692e444c75b4833475fa56db0 (patch) | |
tree | a83f3077501ecc47ac016d2f9fd5fc1ffdb8825d /Lib/random.py | |
parent | ee1bded0466f4b215f39cb37c53a00d65e2a0bf0 (diff) | |
download | cpython-7b0cf76b72a499c692e444c75b4833475fa56db0.zip cpython-7b0cf76b72a499c692e444c75b4833475fa56db0.tar.gz cpython-7b0cf76b72a499c692e444c75b4833475fa56db0.tar.bz2 |
* Migrate sample distribution test from random.py to test_random.py.
* Use Sets module to more clearly articulate a couple of tests.
Diffstat (limited to 'Lib/random.py')
-rw-r--r-- | Lib/random.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Lib/random.py b/Lib/random.py index 3db1f1a..2d4859c 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -743,9 +743,6 @@ def _test_generator(n, funccall): print 'avg %g, stddev %g, min %g, max %g' % \ (avg, stddev, smallest, largest) -def _sample_generator(n, k): - # Return a fixed element from the sample. Validates random ordering. - return sample(xrange(n), k)[k//2] def _test(N=2000): _test_generator(N, 'random()') @@ -764,8 +761,6 @@ def _test(N=2000): _test_generator(N, 'gammavariate(200.0, 1.0)') _test_generator(N, 'gauss(0.0, 1.0)') _test_generator(N, 'betavariate(3.0, 3.0)') - _test_generator(N, '_sample_generator(50, 5)') # expected s.d.: 14.4 - _test_generator(N, '_sample_generator(50, 45)') # expected s.d.: 14.4 # Create one instance, seeded from current time, and export its methods # as module-level functions. The functions share state across all uses |