Skip to content

Commit 46a3228

Browse files
committed
DEP: Promote catch_warn_reset FutureWarning to DeprecationWarning
1 parent 54c38f8 commit 46a3228

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nibabel/testing/__init__.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
skipif = dec.skipif
2222
slow = dec.slow
2323

24+
from ..deprecated import deprecate_with_version as _deprecate_with_version
25+
2426
# Allow failed import of nose if not now running tests
2527
try:
2628
from nose.tools import (assert_equal, assert_not_equal,
@@ -187,12 +189,11 @@ class suppress_warnings(error_warnings):
187189
filter = 'ignore'
188190

189191

192+
@_deprecate_with_version('catch_warn_reset is deprecated; use '
193+
'nibabel.testing.clear_and_catch_warnings.',
194+
since='2.1.0', until='3.0.0')
190195
class catch_warn_reset(clear_and_catch_warnings):
191-
192-
def __init__(self, *args, **kwargs):
193-
warnings.warn('catch_warn_reset is deprecated and will be removed in '
194-
'nibabel v3.0; use nibabel.testing.clear_and_catch_warnings.',
195-
FutureWarning)
196+
pass
196197

197198

198199
EXTRA_SET = os.environ.get('NIPY_EXTRA_TESTS', '').split(',')

0 commit comments

Comments
 (0)