|
44 | 44 | from nose import SkipTest
|
45 | 45 | from nose.tools import (assert_true, assert_false, assert_raises, assert_equal)
|
46 | 46 |
|
47 |
| -from numpy.testing import assert_almost_equal, assert_array_equal, assert_warns |
| 47 | +from numpy.testing import assert_almost_equal, assert_array_equal, assert_warns, assert_allclose |
48 | 48 | from ..testing import clear_and_catch_warnings
|
49 | 49 | from ..tmpdirs import InTemporaryDirectory
|
50 | 50 |
|
@@ -314,18 +314,18 @@ def _check_proxy_interface(self, imaker, meth_name):
|
314 | 314 | # New data dtype, no caching, doesn't use or alter cache
|
315 | 315 | fdata_new_dt = img.get_fdata(caching='unchanged', dtype='f4')
|
316 | 316 | # We get back the original read, not the modified cache
|
317 |
| - assert_array_equal(fdata_new_dt, proxy_data.astype('f4')) |
| 317 | + assert_allclose(fdata_new_dt, proxy_data.astype('f4'), rtol=1e-05, atol=1e-08) |
318 | 318 | assert_equal(fdata_new_dt.dtype, np.float32)
|
319 | 319 | # The original cache stays in place, for default float64
|
320 | 320 | assert_array_equal(img.get_fdata(), 42)
|
321 | 321 | # And for not-default float32, because we haven't cached
|
322 | 322 | fdata_new_dt[:] = 43
|
323 | 323 | fdata_new_dt = img.get_fdata(caching='unchanged', dtype='f4')
|
324 |
| - assert_array_equal(fdata_new_dt, proxy_data.astype('f4')) |
| 324 | + assert_allclose(fdata_new_dt, proxy_data.astype('f4'), rtol=1e-05, atol=1e-08) |
325 | 325 | # Until we reset with caching='fill', at which point we
|
326 | 326 | # drop the original float64 cache, and have a float32 cache
|
327 | 327 | fdata_new_dt = img.get_fdata(caching='fill', dtype='f4')
|
328 |
| - assert_array_equal(fdata_new_dt, proxy_data.astype('f4')) |
| 328 | + assert_allclose(fdata_new_dt, proxy_data.astype('f4'), rtol=1e-05, atol=1e-08) |
329 | 329 | # We're using the cache, for dtype='f4' reads
|
330 | 330 | fdata_new_dt[:] = 43
|
331 | 331 | assert_array_equal(img.get_fdata(dtype='f4'), 43)
|
|
0 commit comments