File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 9
9
from __future__ import with_statement
10
10
11
11
import os
12
- import tempfile
13
12
14
13
import numpy as np
15
14
26
25
from numpy .testing import assert_array_equal , assert_array_almost_equal
27
26
28
27
from ..testing import data_path
28
+ from ..tmpdirs import InTemporaryDirectory
29
29
30
30
ecat_file = os .path .join (data_path , 'tinypet.v' )
31
31
@@ -200,9 +200,10 @@ def test_file(self):
200
200
self .example_file )
201
201
202
202
def test_save (self ):
203
- with tempfile .NamedTemporaryFile (suffix = '.v' ) as tmp_file :
204
- self .img .to_filename (tmp_file .name )
205
- other = self .image_class .load (tmp_file .name )
203
+ tmp_file = 'tinypet_tmp.v'
204
+ with InTemporaryDirectory () as tmp_dir :
205
+ self .img .to_filename (tmp_file )
206
+ other = self .image_class .load (tmp_file )
206
207
assert_equal (self .img .get_data ().all (), other .get_data ().all ())
207
208
208
209
def test_data (self ):
You can’t perform that action at this time.
0 commit comments