diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-09-06 13:15:22 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-09-06 13:27:05 +0200 |
commit | 3ea3dece5a5ef586a07310e12236669220eada07 (patch) | |
tree | 82a41acb6b76ecb6aaa04d12060f9d7a2f1adebd /numpy/random/tests/test_random.py | |
parent | dfc567790badcc87822a39f5c35f0dd78b8c1599 (diff) | |
download | numpy-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.py | 9 |
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): |