summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-01-17 17:23:23 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-01-17 17:23:23 (GMT)
commit7b0cf76b72a499c692e444c75b4833475fa56db0 (patch)
treea83f3077501ecc47ac016d2f9fd5fc1ffdb8825d /Lib/random.py
parentee1bded0466f4b215f39cb37c53a00d65e2a0bf0 (diff)
downloadcpython-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.py5
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