@@ -123,7 +123,7 @@ def validate_header_deprecated(self, imaker, params):
123
123
hdr = img .get_header ()
124
124
assert hdr is img .header
125
125
126
- def validate_filenames (self , imaker , params ):
126
+ def validate_filenames (self , imaker , params , ** kwargs ):
127
127
# Validate the filename, file_map interface
128
128
129
129
if not self .can_save :
@@ -160,7 +160,7 @@ def validate_filenames(self, imaker, params):
160
160
warnings .filterwarnings ('error' ,
161
161
category = DeprecationWarning ,
162
162
module = r"nibabel.*" )
163
- img .to_filename (path )
163
+ img .to_filename (path , ** kwargs )
164
164
rt_img = img .__class__ .from_filename (path )
165
165
assert_array_equal (img .shape , rt_img .shape )
166
166
assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
@@ -456,7 +456,7 @@ def validate_shape_deprecated(self, imaker, params):
456
456
with pytest .raises (ExpiredDeprecationError ):
457
457
img .get_shape ()
458
458
459
- def validate_mmap_parameter (self , imaker , params ):
459
+ def validate_mmap_parameter (self , imaker , params , ** kwargs ):
460
460
img = imaker ()
461
461
fname = img .get_filename ()
462
462
with InTemporaryDirectory ():
@@ -468,7 +468,7 @@ def validate_mmap_parameter(self, imaker, params):
468
468
if not img .rw or not img .valid_exts :
469
469
return
470
470
fname = 'image' + img .valid_exts [0 ]
471
- img .to_filename (fname )
471
+ img .to_filename (fname , ** kwargs )
472
472
rt_img = img .__class__ .from_filename (fname , mmap = True )
473
473
assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
474
474
rt_img = img .__class__ .from_filename (fname , mmap = False )
@@ -533,22 +533,22 @@ def validate_affine_deprecated(self, imaker, params):
533
533
534
534
535
535
class SerializeMixin (object ):
536
- def validate_to_bytes (self , imaker , params ):
536
+ def validate_to_bytes (self , imaker , params , ** kwargs ):
537
537
img = imaker ()
538
538
serialized = img .to_bytes ()
539
539
with InTemporaryDirectory ():
540
540
fname = 'img' + self .standard_extension
541
- img .to_filename (fname )
541
+ img .to_filename (fname , ** kwargs )
542
542
with open (fname , 'rb' ) as fobj :
543
543
file_contents = fobj .read ()
544
544
assert serialized == file_contents
545
545
546
- def validate_from_bytes (self , imaker , params ):
546
+ def validate_from_bytes (self , imaker , params , ** kwargs ):
547
547
img = imaker ()
548
548
klass = getattr (self , 'klass' , img .__class__ )
549
549
with InTemporaryDirectory ():
550
550
fname = 'img' + self .standard_extension
551
- img .to_filename (fname )
551
+ img .to_filename (fname , ** kwargs )
552
552
553
553
all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
554
554
for img_params in all_images :
@@ -561,12 +561,12 @@ def validate_from_bytes(self, imaker, params):
561
561
del img_a
562
562
del img_b
563
563
564
- def validate_to_from_bytes (self , imaker , params ):
564
+ def validate_to_from_bytes (self , imaker , params , ** kwargs ):
565
565
img = imaker ()
566
566
klass = getattr (self , 'klass' , img .__class__ )
567
567
with InTemporaryDirectory ():
568
568
fname = 'img' + self .standard_extension
569
- img .to_filename (fname )
569
+ img .to_filename (fname , ** kwargs )
570
570
571
571
all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
572
572
for img_params in all_images :
0 commit comments