Skip to content

Commit 0665a92

Browse files
committed
fix: Ignore warning that may not be emitted
1 parent 32a24e0 commit 0665a92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nibabel/tests/test_processing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""Testing processing module"""
1010

1111
import logging
12+
import warnings
1213
from os.path import dirname
1314
from os.path import join as pjoin
1415

@@ -169,7 +170,8 @@ def test_resample_from_to(caplog):
169170
exp_out[1:, :, :] = data[1, :, :]
170171
assert_almost_equal(out.dataobj, exp_out)
171172
out = resample_from_to(img, trans_p_25_img)
172-
with pytest.warns(UserWarning): # Suppress scipy warning
173+
with warnings.catch_warnings():
174+
warnings.simplefilter('ignore', UserWarning)
173175
exp_out = spnd.affine_transform(data, [1, 1, 1], [-0.25, 0, 0], order=3)
174176
assert_almost_equal(out.dataobj, exp_out)
175177
# Test cval

0 commit comments

Comments
 (0)