@@ -58,7 +58,7 @@ def test_dtype(self):
58
58
hdr .get_data_dtype ()
59
59
60
60
def test_header_codes (self ):
61
- fid = open (ecat_file , 'rb' )
61
+ fid = open (self . example_file , 'rb' )
62
62
hdr = self .header_class ()
63
63
newhdr = hdr .from_fileobj (fid )
64
64
fid .close ()
@@ -119,6 +119,7 @@ def test_mlist_errors(self):
119
119
hdr = self .header_class .from_fileobj (fid )
120
120
hdr ['num_frames' ] = 6
121
121
mlist = read_mlist (fid , hdr .endianness )
122
+ fid .close ()
122
123
mlist = np .array ([[1.68427540e+07 , 3.00000000e+00 ,
123
124
1.20350000e+04 , 1.00000000e+00 ],
124
125
[1.68427530e+07 , 1.20360000e+04 ,
@@ -156,6 +157,7 @@ class TestEcatSubHeader(TestCase):
156
157
hdr = header_class .from_fileobj (fid )
157
158
mlist = read_mlist (fid , hdr .endianness )
158
159
subhdr = subhdr_class (hdr , mlist , fid )
160
+ fid .close ()
159
161
160
162
def test_subheader_size (self ):
161
163
assert self .subhdr_class ._subhdrdtype .itemsize == 510
@@ -184,6 +186,7 @@ class TestEcatImage(TestCase):
184
186
image_class = EcatImage
185
187
example_file = ecat_file
186
188
img = image_class .load (example_file )
189
+ example_file .close ()
187
190
188
191
def test_file (self ):
189
192
assert (self .img .file_map ['header' ].filename ==
0 commit comments