@@ -123,7 +123,7 @@ def validate_header_deprecated(self, imaker, params):
123123 hdr = img .get_header ()
124124 assert hdr is img .header
125125
126- def validate_filenames (self , imaker , params ):
126+ def validate_filenames (self , imaker , params , ** kwargs ):
127127 # Validate the filename, file_map interface
128128
129129 if not self .can_save :
@@ -160,7 +160,7 @@ def validate_filenames(self, imaker, params):
160160 warnings .filterwarnings ('error' ,
161161 category = DeprecationWarning ,
162162 module = r"nibabel.*" )
163- img .to_filename (path )
163+ img .to_filename (path , ** kwargs )
164164 rt_img = img .__class__ .from_filename (path )
165165 assert_array_equal (img .shape , rt_img .shape )
166166 assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
@@ -456,7 +456,7 @@ def validate_shape_deprecated(self, imaker, params):
456456 with pytest .raises (ExpiredDeprecationError ):
457457 img .get_shape ()
458458
459- def validate_mmap_parameter (self , imaker , params ):
459+ def validate_mmap_parameter (self , imaker , params , ** kwargs ):
460460 img = imaker ()
461461 fname = img .get_filename ()
462462 with InTemporaryDirectory ():
@@ -468,7 +468,7 @@ def validate_mmap_parameter(self, imaker, params):
468468 if not img .rw or not img .valid_exts :
469469 return
470470 fname = 'image' + img .valid_exts [0 ]
471- img .to_filename (fname )
471+ img .to_filename (fname , ** kwargs )
472472 rt_img = img .__class__ .from_filename (fname , mmap = True )
473473 assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
474474 rt_img = img .__class__ .from_filename (fname , mmap = False )
@@ -533,22 +533,22 @@ def validate_affine_deprecated(self, imaker, params):
533533
534534
535535class SerializeMixin (object ):
536- def validate_to_bytes (self , imaker , params ):
536+ def validate_to_bytes (self , imaker , params , ** kwargs ):
537537 img = imaker ()
538538 serialized = img .to_bytes ()
539539 with InTemporaryDirectory ():
540540 fname = 'img' + self .standard_extension
541- img .to_filename (fname )
541+ img .to_filename (fname , ** kwargs )
542542 with open (fname , 'rb' ) as fobj :
543543 file_contents = fobj .read ()
544544 assert serialized == file_contents
545545
546- def validate_from_bytes (self , imaker , params ):
546+ def validate_from_bytes (self , imaker , params , ** kwargs ):
547547 img = imaker ()
548548 klass = getattr (self , 'klass' , img .__class__ )
549549 with InTemporaryDirectory ():
550550 fname = 'img' + self .standard_extension
551- img .to_filename (fname )
551+ img .to_filename (fname , ** kwargs )
552552
553553 all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
554554 for img_params in all_images :
@@ -561,12 +561,12 @@ def validate_from_bytes(self, imaker, params):
561561 del img_a
562562 del img_b
563563
564- def validate_to_from_bytes (self , imaker , params ):
564+ def validate_to_from_bytes (self , imaker , params , ** kwargs ):
565565 img = imaker ()
566566 klass = getattr (self , 'klass' , img .__class__ )
567567 with InTemporaryDirectory ():
568568 fname = 'img' + self .standard_extension
569- img .to_filename (fname )
569+ img .to_filename (fname , ** kwargs )
570570
571571 all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
572572 for img_params in all_images :
0 commit comments