From 7b0cf76b72a499c692e444c75b4833475fa56db0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 17 Jan 2003 17:23:23 +0000 Subject: * Migrate sample distribution test from random.py to test_random.py. * Use Sets module to more clearly articulate a couple of tests. --- Lib/random.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Lib/random.py') diff --git a/Lib/random.py b/Lib/random.py index 3db1f1a3fa..2d4859cf02 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 -- cgit v1.2.1