16
16
17
17
import nibabel .gifti as gi
18
18
from nibabel .gifti .util import gifti_endian_codes
19
+ from nibabel .gifti .parse_gifti_fast import Outputter , parse_gifti_file
19
20
from nibabel .loadsave import load , save
20
21
from nibabel .nifti1 import xform_codes
21
22
from nibabel .tmpdirs import InTemporaryDirectory
@@ -286,12 +287,14 @@ def test_labeltable_deprecations():
286
287
287
288
# Test deprecation
288
289
with clear_and_catch_warnings () as w :
289
- warnings .filterwarnings ('once ' , category = DeprecationWarning )
290
+ warnings .filterwarnings ('always ' , category = DeprecationWarning )
290
291
assert_equal (lt , img .get_labeltable ())
292
+ assert_equal (len (w ), 1 )
291
293
292
294
with clear_and_catch_warnings () as w :
293
- warnings .filterwarnings ('once ' , category = DeprecationWarning )
295
+ warnings .filterwarnings ('always ' , category = DeprecationWarning )
294
296
img .set_labeltable (lt )
297
+ assert_equal (len (w ), 1 )
295
298
assert_equal (lt , img .labeltable )
296
299
297
300
@@ -313,3 +316,17 @@ def test_parse_dataarrays():
313
316
load (fn )
314
317
assert_equal (len (w ), 1 )
315
318
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