summaryrefslogtreecommitdiff
path: root/numpy/random/tests/test_random.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-09-06 13:15:22 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-09-06 13:27:05 +0200
commit3ea3dece5a5ef586a07310e12236669220eada07 (patch)
tree82a41acb6b76ecb6aaa04d12060f9d7a2f1adebd /numpy/random/tests/test_random.py
parentdfc567790badcc87822a39f5c35f0dd78b8c1599 (diff)
downloadnumpy-3ea3dece5a5ef586a07310e12236669220eada07.tar.gz
TST: accept small error in threaded random test
freebsd and windows change x87 precision mode (fctrl bit 8 and 9) from extended to double in child threads so the random numbers cannot be exactly the same from master and child threads. see gh-4909
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r--numpy/random/tests/test_random.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index b64c9d6cd..e18f1c580 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -6,6 +6,7 @@ from numpy.testing import (
assert_warns)
from numpy import random
from numpy.compat import asbytes
+import sys
class TestSeed(TestCase):
def test_scalar(self):
@@ -681,7 +682,13 @@ class TestThread:
for s, o in zip(self.seeds, out2):
function(np.random.RandomState(s), o)
- np.testing.assert_array_equal(out1, out2)
+ # these platforms change x87 fpu precision mode in threads
+ if (np.intp().dtype.itemsize == 4 and
+ (sys.platform == "win32" or
+ sys.platform.startswith("gnukfreebsd"))):
+ np.testing.assert_array_almost_equal(out1, out2)
+ else:
+ np.testing.assert_array_equal(out1, out2)
def test_normal(self):
def gen_random(state, out):