1616
1717import nibabel .gifti as gi
1818from nibabel .gifti .util import gifti_endian_codes
19+ from nibabel .gifti .parse_gifti_fast import Outputter , parse_gifti_file
1920from nibabel .loadsave import load , save
2021from nibabel .nifti1 import xform_codes
2122from nibabel .tmpdirs import InTemporaryDirectory
@@ -286,12 +287,14 @@ def test_labeltable_deprecations():
286287
287288 # Test deprecation
288289 with clear_and_catch_warnings () as w :
289- warnings .filterwarnings ('once ' , category = DeprecationWarning )
290+ warnings .filterwarnings ('always ' , category = DeprecationWarning )
290291 assert_equal (lt , img .get_labeltable ())
292+ assert_equal (len (w ), 1 )
291293
292294 with clear_and_catch_warnings () as w :
293- warnings .filterwarnings ('once ' , category = DeprecationWarning )
295+ warnings .filterwarnings ('always ' , category = DeprecationWarning )
294296 img .set_labeltable (lt )
297+ assert_equal (len (w ), 1 )
295298 assert_equal (lt , img .labeltable )
296299
297300
@@ -313,3 +316,17 @@ def test_parse_dataarrays():
313316 load (fn )
314317 assert_equal (len (w ), 1 )
315318 assert_equal (img .numDA , 0 )
319+
320+ def test_parse_deprecated ():
321+
322+
323+ # Test deprecation
324+ with clear_and_catch_warnings () as w :
325+ warnings .filterwarnings ('always' , category = DeprecationWarning )
326+ op = Outputter ()
327+ assert_equal (len (w ), 1 )
328+
329+ with clear_and_catch_warnings () as w :
330+ warnings .filterwarnings ('always' , category = DeprecationWarning )
331+ assert_raises (ValueError , parse_gifti_file )
332+ assert_equal (len (w ), 1 )
0 commit comments