Skip to content

Commit 98e20ae

Browse files
committed
TEST: Remove some get_data tests
1 parent 8a066c0 commit 98e20ae

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

nibabel/tests/test_image_api.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class DataInterfaceMixin(GetSetDtypeMixin):
209209
Use this mixin if your image has a ``dataobj`` property that contains an
210210
array or an array-like thing.
211211
"""
212-
meth_names = ('get_fdata', 'get_data')
212+
meth_names = ('get_fdata',)
213213

214214
def validate_data_interface(self, imaker, params):
215215
# Check get data returns array, and caches
@@ -304,27 +304,6 @@ def _check_proxy_interface(self, imaker, meth_name):
304304
with maybe_deprecated(meth_name):
305305
data_again = method()
306306
assert data is data_again
307-
# Check the interaction of caching with get_data, get_fdata.
308-
# Caching for `get_data` should have no effect on caching for
309-
# get_fdata, and vice versa.
310-
# Modify the cached data
311-
data[:] = 43
312-
# Load using the other data fetch method
313-
other_name = set(self.meth_names).difference({meth_name}).pop()
314-
other_method = getattr(img, other_name)
315-
with maybe_deprecated(other_name):
316-
other_data = other_method()
317-
# We get the original data, not the modified cache
318-
assert_array_equal(proxy_data, other_data)
319-
assert not np.all(data == other_data)
320-
# We can modify the other cache, without affecting the first
321-
other_data[:] = 44
322-
with maybe_deprecated(other_name):
323-
assert_array_equal(other_method(), 44)
324-
with pytest.deprecated_call():
325-
assert not np.all(method() == other_method())
326-
if meth_name != 'get_fdata':
327-
return
328307
# Check that caching refreshes for new floating point type.
329308
img.uncache()
330309
fdata = img.get_fdata()

nibabel/tests/test_spatialimages.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,9 @@ def test_slicer(self):
522522
pass
523523
else:
524524
sliced_data = in_data[sliceobj]
525-
with pytest.deprecated_call():
526-
assert (sliced_data == sliced_img.get_data()).all()
527525
assert (sliced_data == sliced_img.get_fdata()).all()
528526
assert (sliced_data == sliced_img.dataobj).all()
529527
assert (sliced_data == img.dataobj[sliceobj]).all()
530-
with pytest.deprecated_call():
531-
assert (sliced_data == img.get_data()[sliceobj]).all()
532528
assert (sliced_data == img.get_fdata()[sliceobj]).all()
533529

534530

0 commit comments

Comments
 (0)