|
13 | 13 | import sys
|
14 | 14 | import warnings
|
15 | 15 | from pkg_resources import resource_filename
|
16 |
| -from os.path import dirname, abspath, join as pjoin |
17 | 16 |
|
18 | 17 | import unittest
|
19 | 18 |
|
20 | 19 | import numpy as np
|
21 |
| -from numpy.testing import assert_array_equal, assert_warns |
22 |
| -from numpy.testing import dec |
23 |
| -skipif = dec.skipif |
24 |
| -slow = dec.slow |
| 20 | +from numpy.testing import assert_array_equal |
25 | 21 |
|
26 |
| -from ..deprecated import deprecate_with_version as _deprecate_with_version |
27 | 22 | from .np_features import memmap_after_ufunc
|
28 | 23 | from .helpers import bytesio_filemap, bytesio_round_trip, assert_data_similar
|
29 | 24 |
|
@@ -63,7 +58,7 @@ def assert_allclose_safely(a, b, match_nans=True, rtol=1e-5, atol=1e-8):
|
63 | 58 | a, b = np.broadcast_arrays(a, b)
|
64 | 59 | if match_nans:
|
65 | 60 | nans = np.isnan(a)
|
66 |
| - np.testing.assert_array_equal(nans, np.isnan(b)) |
| 61 | + assert_array_equal(nans, np.isnan(b)) |
67 | 62 | to_test = ~nans
|
68 | 63 | else:
|
69 | 64 | to_test = np.ones(a.shape, dtype=bool)
|
@@ -199,20 +194,12 @@ class suppress_warnings(error_warnings):
|
199 | 194 | filter = 'ignore'
|
200 | 195 |
|
201 | 196 |
|
202 |
| -@_deprecate_with_version('catch_warn_reset is deprecated; use ' |
203 |
| - 'nibabel.testing.clear_and_catch_warnings.', |
204 |
| - since='2.1.0', until='3.0.0') |
205 |
| -class catch_warn_reset(clear_and_catch_warnings): |
206 |
| - pass |
207 |
| - |
208 |
| - |
209 | 197 | EXTRA_SET = os.environ.get('NIPY_EXTRA_TESTS', '').split(',')
|
210 | 198 |
|
211 | 199 |
|
212 | 200 | def runif_extra_has(test_str):
|
213 | 201 | """Decorator checks to see if NIPY_EXTRA_TESTS env var contains test_str"""
|
214 |
| - return skipif(test_str not in EXTRA_SET, |
215 |
| - "Skip {0} tests.".format(test_str)) |
| 202 | + return unittest.skipUnless(test_str in EXTRA_SET, "Skip {0} tests.".format(test_str)) |
216 | 203 |
|
217 | 204 |
|
218 | 205 | def assert_arr_dict_equal(dict1, dict2):
|
|
0 commit comments