Skip to content

Commit 27146c6

Browse files
committed
TEST: Use skipIf rather than warn + return for test_multiload
1 parent 0634da4 commit 27146c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nibabel/tests/test_filehandles.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from os.path import join as pjoin
66
import shutil
77
from tempfile import mkdtemp
8-
from warnings import warn
8+
import unittest
99

1010
import numpy as np
1111

@@ -21,13 +21,11 @@
2121
from ..nifti1 import Nifti1Image
2222

2323

24+
@unittest.skipIf(SOFT_LIMIT > 4900, "It would take too long to test filehandles")
2425
def test_multiload():
2526
# Make a tiny image, save, load many times. If we are leaking filehandles,
2627
# this will cause us to run out and generate an error
2728
N = SOFT_LIMIT + 100
28-
if N > 5000:
29-
warn('It would take too long to test file handles, aborting')
30-
return
3129
arr = np.arange(24).reshape((2, 3, 4))
3230
img = Nifti1Image(arr, np.eye(4))
3331
imgs = []

0 commit comments

Comments
 (0)