@@ -118,7 +118,7 @@ def validate_header_deprecated(self, imaker, params):
118
118
hdr = img .get_header ()
119
119
assert hdr is img .header
120
120
121
- def validate_filenames (self , imaker , params ):
121
+ def validate_filenames (self , imaker , params , ** kwargs ):
122
122
# Validate the filename, file_map interface
123
123
124
124
if not self .can_save :
@@ -155,7 +155,7 @@ def validate_filenames(self, imaker, params):
155
155
warnings .filterwarnings ('error' ,
156
156
category = DeprecationWarning ,
157
157
module = r"nibabel.*" )
158
- img .to_filename (path )
158
+ img .to_filename (path , ** kwargs )
159
159
rt_img = img .__class__ .from_filename (path )
160
160
assert_array_equal (img .shape , rt_img .shape )
161
161
assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
@@ -433,7 +433,7 @@ def validate_shape_deprecated(self, imaker, params):
433
433
with pytest .raises (ExpiredDeprecationError ):
434
434
img .get_shape ()
435
435
436
- def validate_mmap_parameter (self , imaker , params ):
436
+ def validate_mmap_parameter (self , imaker , params , ** kwargs ):
437
437
img = imaker ()
438
438
fname = img .get_filename ()
439
439
with InTemporaryDirectory ():
@@ -445,7 +445,7 @@ def validate_mmap_parameter(self, imaker, params):
445
445
if not img .rw or not img .valid_exts :
446
446
return
447
447
fname = 'image' + img .valid_exts [0 ]
448
- img .to_filename (fname )
448
+ img .to_filename (fname , ** kwargs )
449
449
rt_img = img .__class__ .from_filename (fname , mmap = True )
450
450
assert_almost_equal (img .get_fdata (), rt_img .get_fdata ())
451
451
rt_img = img .__class__ .from_filename (fname , mmap = False )
@@ -510,22 +510,22 @@ def validate_affine_deprecated(self, imaker, params):
510
510
511
511
512
512
class SerializeMixin (object ):
513
- def validate_to_bytes (self , imaker , params ):
513
+ def validate_to_bytes (self , imaker , params , ** kwargs ):
514
514
img = imaker ()
515
515
serialized = img .to_bytes ()
516
516
with InTemporaryDirectory ():
517
517
fname = 'img' + self .standard_extension
518
- img .to_filename (fname )
518
+ img .to_filename (fname , ** kwargs )
519
519
with open (fname , 'rb' ) as fobj :
520
520
file_contents = fobj .read ()
521
521
assert serialized == file_contents
522
522
523
- def validate_from_bytes (self , imaker , params ):
523
+ def validate_from_bytes (self , imaker , params , ** kwargs ):
524
524
img = imaker ()
525
525
klass = getattr (self , 'klass' , img .__class__ )
526
526
with InTemporaryDirectory ():
527
527
fname = 'img' + self .standard_extension
528
- img .to_filename (fname )
528
+ img .to_filename (fname , ** kwargs )
529
529
530
530
all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
531
531
for img_params in all_images :
@@ -538,12 +538,12 @@ def validate_from_bytes(self, imaker, params):
538
538
del img_a
539
539
del img_b
540
540
541
- def validate_to_from_bytes (self , imaker , params ):
541
+ def validate_to_from_bytes (self , imaker , params , ** kwargs ):
542
542
img = imaker ()
543
543
klass = getattr (self , 'klass' , img .__class__ )
544
544
with InTemporaryDirectory ():
545
545
fname = 'img' + self .standard_extension
546
- img .to_filename (fname )
546
+ img .to_filename (fname , ** kwargs )
547
547
548
548
all_images = list (getattr (self , 'example_images' , [])) + [{'fname' : fname }]
549
549
for img_params in all_images :
0 commit comments