Skip to content

Commit 287f0bd

Browse files
committed
TEST: Further adjustment to arrayproxy benchmark
1 parent 31cc1a0 commit 287f0bd

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

nibabel/benchmarks/bench_arrayproxy_slicing.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@
5959
HAVE_IGZIP = [False]
6060

6161

62-
@contextlib.contextmanager
63-
def patch_indexed_gzip(have_igzip):
64-
65-
atts = ['nibabel.openers.HAVE_INDEXED_GZIP']
66-
67-
with mock.patch(atts[0], have_igzip), mock.patch(atts[1], have_igzip):
68-
yield
69-
70-
7162
def bench_arrayproxy_slicing():
7263

7364
print_git_title('\nArrayProxy gzip slicing')
@@ -153,14 +144,15 @@ def fmt_sliceobj(sliceobj):
153144
# load uncompressed and compressed versions of the image
154145
img = nib.load(testfile, keep_file_open=keep_open)
155146

156-
with patch_indexed_gzip(have_igzip):
147+
with mock.patch('nibabel.openers.HAVE_INDEXED_GZIP', have_igzip):
157148
imggz = nib.load(testfilegz, keep_file_open=keep_open)
158149

159150
def basefunc():
160151
img.dataobj[fix_sliceobj(sliceobj)]
161152

162153
def testfunc():
163-
with patch_indexed_gzip(have_igzip):
154+
with mock.patch('nibabel.openers.HAVE_INDEXED_GZIP',
155+
have_igzip):
164156
imggz.dataobj[fix_sliceobj(sliceobj)]
165157

166158
# make sure nothing is floating around from the previous test

0 commit comments

Comments
 (0)