Skip to content

Commit 89ca894

Browse files
committed
TEST: Prepare tests to fail at 6.0
1 parent a3466a4 commit 89ca894

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

nibabel/gifti/tests/test_gifti.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ... import load
1515
from ...fileholders import FileHolder
1616
from ...nifti1 import data_type_codes
17-
from ...testing import get_test_data
17+
from ...testing import deprecated_to, expires, get_test_data
1818
from .. import (
1919
GiftiCoordSystem,
2020
GiftiDataArray,
@@ -275,27 +275,29 @@ def test_labeltable():
275275
assert len(img.labeltable.labels) == 2
276276

277277

278+
@expires('6.0.0')
278279
def test_metadata():
279280
md = GiftiMetaData(key='value')
280281
# Old initialization methods
281-
with pytest.warns(DeprecationWarning) as w:
282+
with deprecated_to('6.0.0'):
282283
nvpair = GiftiNVPairs('key', 'value')
283284
with pytest.warns(FutureWarning) as w:
284285
md2 = GiftiMetaData(nvpair=nvpair)
285286
assert len(w) == 1
286-
with pytest.warns(DeprecationWarning) as w:
287+
with deprecated_to('6.0.0'):
287288
md3 = GiftiMetaData.from_dict({'key': 'value'})
288289
assert md == md2 == md3 == {'key': 'value'}
289290
# .data as a list of NVPairs is going away
290-
with pytest.warns(DeprecationWarning) as w:
291+
with deprecated_to('6.0.0'):
291292
assert md.data[0].name == 'key'
293+
with deprecated_to('6.0.0'):
292294
assert md.data[0].value == 'value'
293-
assert len(w) == 2
294295

295296

297+
@expires('6.0.0')
296298
def test_metadata_list_interface():
297299
md = GiftiMetaData(key='value')
298-
with pytest.warns(DeprecationWarning):
300+
with deprecated_to('6.0.0'):
299301
mdlist = md.data
300302
assert len(mdlist) == 1
301303
assert mdlist[0].name == 'key'
@@ -312,7 +314,7 @@ def test_metadata_list_interface():
312314
assert md['foo'] == 'bar'
313315

314316
# Append new NVPair
315-
with pytest.warns(DeprecationWarning) as w:
317+
with deprecated_to('6.0.0'):
316318
nvpair = GiftiNVPairs('key', 'value')
317319
mdlist.append(nvpair)
318320
assert len(mdlist) == 2

0 commit comments

Comments
 (0)