14
14
from ... import load
15
15
from ...fileholders import FileHolder
16
16
from ...nifti1 import data_type_codes
17
- from ...testing import get_test_data
17
+ from ...testing import deprecated_to , expires , get_test_data
18
18
from .. import (
19
19
GiftiCoordSystem ,
20
20
GiftiDataArray ,
@@ -275,27 +275,29 @@ def test_labeltable():
275
275
assert len (img .labeltable .labels ) == 2
276
276
277
277
278
+ @expires ('6.0.0' )
278
279
def test_metadata ():
279
280
md = GiftiMetaData (key = 'value' )
280
281
# Old initialization methods
281
- with pytest . warns ( DeprecationWarning ) as w :
282
+ with deprecated_to ( '6.0.0' ) :
282
283
nvpair = GiftiNVPairs ('key' , 'value' )
283
284
with pytest .warns (FutureWarning ) as w :
284
285
md2 = GiftiMetaData (nvpair = nvpair )
285
286
assert len (w ) == 1
286
- with pytest . warns ( DeprecationWarning ) as w :
287
+ with deprecated_to ( '6.0.0' ) :
287
288
md3 = GiftiMetaData .from_dict ({'key' : 'value' })
288
289
assert md == md2 == md3 == {'key' : 'value' }
289
290
# .data as a list of NVPairs is going away
290
- with pytest . warns ( DeprecationWarning ) as w :
291
+ with deprecated_to ( '6.0.0' ) :
291
292
assert md .data [0 ].name == 'key'
293
+ with deprecated_to ('6.0.0' ):
292
294
assert md .data [0 ].value == 'value'
293
- assert len (w ) == 2
294
295
295
296
297
+ @expires ('6.0.0' )
296
298
def test_metadata_list_interface ():
297
299
md = GiftiMetaData (key = 'value' )
298
- with pytest . warns ( DeprecationWarning ):
300
+ with deprecated_to ( '6.0.0' ):
299
301
mdlist = md .data
300
302
assert len (mdlist ) == 1
301
303
assert mdlist [0 ].name == 'key'
@@ -312,7 +314,7 @@ def test_metadata_list_interface():
312
314
assert md ['foo' ] == 'bar'
313
315
314
316
# Append new NVPair
315
- with pytest . warns ( DeprecationWarning ) as w :
317
+ with deprecated_to ( '6.0.0' ) :
316
318
nvpair = GiftiNVPairs ('key' , 'value' )
317
319
mdlist .append (nvpair )
318
320
assert len (mdlist ) == 2
0 commit comments