@@ -228,15 +228,16 @@ def test_labeltable():
228228def test_metadata ():
229229 md = GiftiMetaData (key = 'value' )
230230 # Old initialization methods
231- nvpair = GiftiNVPairs ('key' , 'value' )
231+ with pytest .warns (DeprecationWarning ) as w :
232+ nvpair = GiftiNVPairs ('key' , 'value' )
232233 with pytest .warns (FutureWarning ) as w :
233234 md2 = GiftiMetaData (nvpair = nvpair )
234235 assert len (w ) == 1
235236 with pytest .warns (DeprecationWarning ) as w :
236237 md3 = GiftiMetaData .from_dict ({'key' : 'value' })
237238 assert md == md2 == md3 == {'key' : 'value' }
238239 # .data as a list of NVPairs is going away
239- with pytest .warns (FutureWarning ) as w :
240+ with pytest .warns (DeprecationWarning ) as w :
240241 assert md .data [0 ].name == 'key'
241242 assert md .data [0 ].value == 'value'
242243 assert len (w ) == 2
@@ -247,7 +248,7 @@ def test_metadata():
247248
248249def test_metadata_list_interface ():
249250 md = GiftiMetaData (key = 'value' )
250- with pytest .warns (FutureWarning ):
251+ with pytest .warns (DeprecationWarning ):
251252 mdlist = md .data
252253 assert len (mdlist ) == 1
253254 assert mdlist [0 ].name == 'key'
@@ -264,7 +265,8 @@ def test_metadata_list_interface():
264265 assert md ['foo' ] == 'bar'
265266
266267 # Append new NVPair
267- nvpair = GiftiNVPairs ('key' , 'value' )
268+ with pytest .warns (DeprecationWarning ) as w :
269+ nvpair = GiftiNVPairs ('key' , 'value' )
268270 mdlist .append (nvpair )
269271 assert len (mdlist ) == 2
270272 assert mdlist [1 ].name == 'key'
@@ -278,14 +280,16 @@ def test_metadata_list_interface():
278280 assert len (md ) == 0
279281
280282 # Extension adds multiple keys
281- foobar = GiftiNVPairs ('foo' , 'bar' )
283+ with pytest .warns (DeprecationWarning ) as w :
284+ foobar = GiftiNVPairs ('foo' , 'bar' )
282285 mdlist .extend ([nvpair , foobar ])
283286 assert len (mdlist ) == 2
284287 assert len (md ) == 2
285288 assert md == {'key' : 'value' , 'foo' : 'bar' }
286289
287290 # Insertion updates list order, though we don't attempt to preserve it in the dict
288- lastone = GiftiNVPairs ('last' , 'one' )
291+ with pytest .warns (DeprecationWarning ) as w :
292+ lastone = GiftiNVPairs ('last' , 'one' )
289293 mdlist .insert (1 , lastone )
290294 assert len (mdlist ) == 3
291295 assert len (md ) == 3
@@ -314,7 +318,8 @@ def test_metadata_list_interface():
314318 assert md == {'last' : 'one' }
315319
316320 # And let's remove an old pair with a new object
317- lastoneagain = GiftiNVPairs ('last' , 'one' )
321+ with pytest .warns (DeprecationWarning ) as w :
322+ lastoneagain = GiftiNVPairs ('last' , 'one' )
318323 mdlist .remove (lastoneagain )
319324 assert len (mdlist ) == 0
320325 assert len (md ) == 0
0 commit comments