summaryrefslogtreecommitdiff
path: root/numpy/random/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2009-03-14 20:48:14 +0000
committerCharles Harris <charlesr.harris@gmail.com>2009-03-14 20:48:14 +0000
commit576a6781de434625460e0f8273ec837277474ee0 (patch)
tree4cd73d74bf1a24bcce69cc173b4e57d60055dc33 /numpy/random/tests
parenta1e2f9b5ab6d240655b040c3d3ae0188f1132cb1 (diff)
downloadnumpy-576a6781de434625460e0f8273ec837277474ee0.tar.gz
Make logseries test deterministic.
Diffstat (limited to 'numpy/random/tests')
-rw-r--r--numpy/random/tests/test_random.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index b316d7b79..3c0e5d422 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -20,17 +20,18 @@ class TestRegression(TestCase):
def test_logseries_convergence(self) :
"""Test for ticket #923"""
- N = 100000
+ N = 1000
+ np.random.seed(0)
rvsn = np.random.logseries(0.8, size=N)
# these two frequency counts should be close to theoretical
# numbers with this large sample
# theoretical large N result is 0.49706795
freq = np.sum(rvsn == 1) / float(N)
- msg = "Obsevered frequency was %f, should be > 0.45" % freq
+ msg = "Frequency was %f, should be > 0.45" % freq
assert_(freq > 0.45, msg)
# theoretical large N result is 0.19882718
freq = np.sum(rvsn == 2) / float(N)
- msg = "Obsevered frequency was %f, should be < 0.23" % freq
+ msg = "Frequency was %f, should be < 0.23" % freq
assert_(freq < 0.23, msg)