@@ -118,7 +118,7 @@ def validate_header_deprecated(self, imaker, params):
118118 hdr = img .get_header ()
119119 assert hdr is img .header
120120
121- def validate_filenames (self , imaker , params ):
121+ def validate_filenames (self , imaker , params , ** kwargs ):
122122 # Validate the filename, file_map interface
123123
124124 if not self .can_save :
@@ -155,7 +155,7 @@ def validate_filenames(self, imaker, params):
155155 warnings .filterwarnings ('error' ,
156156 category = DeprecationWarning ,
157157 module = r"nibabel.*" )
158- img .to_filename (path )
158+ img .to_filename (path , ** kwargs )
159159 rt_img = img .__class__ .from_filename (path )
160160 assert_array_equal (img .shape , rt_img .shape )
161161 assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
@@ -433,7 +433,7 @@ def validate_shape_deprecated(self, imaker, params):
433433 with pytest .raises (ExpiredDeprecationError ):
434434 img .get_shape ()
435435
436- def validate_mmap_parameter (self , imaker , params ):
436+ def validate_mmap_parameter (self , imaker , params , ** kwargs ):
437437 img = imaker ()
438438 fname = img .get_filename ()
439439 with InTemporaryDirectory ():
@@ -445,7 +445,7 @@ def validate_mmap_parameter(self, imaker, params):
445445 if not img .rw or not img .valid_exts :
446446 return
447447 fname = 'image' + img .valid_exts [0 ]
448- img .to_filename (fname )
448+ img .to_filename (fname , ** kwargs )
449449 rt_img = img .__class__ .from_filename (fname , mmap = True )
450450 assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
451451 rt_img = img .__class__ .from_filename (fname , mmap = False )
@@ -510,22 +510,22 @@ def validate_affine_deprecated(self, imaker, params):
510510
511511
512512class SerializeMixin (object ):
513- def validate_to_bytes (self , imaker , params ):
513+ def validate_to_bytes (self , imaker , params , ** kwargs ):
514514 img = imaker ()
515515 serialized = img .to_bytes ()
516516 with InTemporaryDirectory ():
517517 fname = 'img' + self .standard_extension
518- img .to_filename (fname )
518+ img .to_filename (fname , ** kwargs )
519519 with open (fname , 'rb' ) as fobj :
520520 file_contents = fobj .read ()
521521 assert serialized == file_contents
522522
523- def validate_from_bytes (self , imaker , params ):
523+ def validate_from_bytes (self , imaker , params , ** kwargs ):
524524 img = imaker ()
525525 klass = getattr (self , 'klass' , img .__class__ )
526526 with InTemporaryDirectory ():
527527 fname = 'img' + self .standard_extension
528- img .to_filename (fname )
528+ img .to_filename (fname , ** kwargs )
529529
530530 all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
531531 for img_params in all_images :
@@ -538,12 +538,12 @@ def validate_from_bytes(self, imaker, params):
538538 del img_a
539539 del img_b
540540
541- def validate_to_from_bytes (self , imaker , params ):
541+ def validate_to_from_bytes (self , imaker , params , ** kwargs ):
542542 img = imaker ()
543543 klass = getattr (self , 'klass' , img .__class__ )
544544 with InTemporaryDirectory ():
545545 fname = 'img' + self .standard_extension
546- img .to_filename (fname )
546+ img .to_filename (fname , ** kwargs )
547547
548548 all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
549549 for img_params in all_images :
0 commit comments