Skip to content

Commit e5ccf06

Browse files
committed
TEST: Fix warning filter to only check for nibabel-generated warnings
1 parent 71098e3 commit e5ccf06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nibabel/tests/test_image_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def validate_filenames(self, imaker, params):
153153
with InTemporaryDirectory():
154154
# Validate that saving or loading a file doesn't use deprecated methods internally
155155
with clear_and_catch_warnings() as w:
156-
warnings.simplefilter('error', DeprecationWarning)
156+
warnings.filterwarnings('error',
157+
category=DeprecationWarning,
158+
module=r"nibabel.*")
157159
img.to_filename(path)
158160
rt_img = img.__class__.from_filename(path)
159161
assert_array_equal(img.shape, rt_img.shape)

0 commit comments

Comments
 (0)