Skip to content

Commit 283bd8e

Browse files
authored
Merge pull request #1155 from DimitriPapadopoulos/ResourceWarning_unclosed_file
TEST: Use class variables and close open file handles in ECAT tests
2 parents 42cbe5d + f0770b9 commit 283bd8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/tests/test_ecat.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_dtype(self):
5959
hdr.get_data_dtype()
6060

6161
def test_header_codes(self):
62-
fid = open(ecat_file, 'rb')
62+
fid = open(self.example_file, 'rb')
6363
hdr = self.header_class()
6464
newhdr = hdr.from_fileobj(fid)
6565
fid.close()
@@ -117,6 +117,7 @@ def test_mlist_errors(self):
117117
hdr = self.header_class.from_fileobj(fid)
118118
hdr['num_frames'] = 6
119119
mlist = read_mlist(fid, hdr.endianness)
120+
fid.close()
120121
mlist = np.array(
121122
[
122123
[1.68427540e07, 3.00000000e00, 1.20350000e04, 1.00000000e00],

0 commit comments

Comments
 (0)