Skip to content

Commit b18479c

Browse files
committed
RF: Remove unused pieces of testing_pytest and switch to unittest skip
1 parent f7885c6 commit b18479c

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

nibabel/testing_pytest/__init__.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@
1313
import sys
1414
import warnings
1515
from pkg_resources import resource_filename
16-
from os.path import dirname, abspath, join as pjoin
1716

1817
import unittest
1918

2019
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
2521

26-
from ..deprecated import deprecate_with_version as _deprecate_with_version
2722
from .np_features import memmap_after_ufunc
2823
from .helpers import bytesio_filemap, bytesio_round_trip, assert_data_similar
2924

@@ -63,7 +58,7 @@ def assert_allclose_safely(a, b, match_nans=True, rtol=1e-5, atol=1e-8):
6358
a, b = np.broadcast_arrays(a, b)
6459
if match_nans:
6560
nans = np.isnan(a)
66-
np.testing.assert_array_equal(nans, np.isnan(b))
61+
assert_array_equal(nans, np.isnan(b))
6762
to_test = ~nans
6863
else:
6964
to_test = np.ones(a.shape, dtype=bool)
@@ -199,20 +194,12 @@ class suppress_warnings(error_warnings):
199194
filter = 'ignore'
200195

201196

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-
209197
EXTRA_SET = os.environ.get('NIPY_EXTRA_TESTS', '').split(',')
210198

211199

212200
def runif_extra_has(test_str):
213201
"""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))
216203

217204

218205
def assert_arr_dict_equal(dict1, dict2):

0 commit comments

Comments
 (0)