Skip to content

Commit 1253e2c

Browse files
MNT: Fix CI warnings
ResourceWarning: unclosed file <_io.BufferedReader name='/home/runner/work/nibabel/nibabel/virtenv/lib/python3.9/site-packages/nibabel/tests/data/tinypet.v'>
1 parent d33a05a commit 1253e2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nibabel/tests/test_ecat.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_dtype(self):
5858
hdr.get_data_dtype()
5959

6060
def test_header_codes(self):
61-
fid = open(ecat_file, 'rb')
61+
fid = open(self.example_file, 'rb')
6262
hdr = self.header_class()
6363
newhdr = hdr.from_fileobj(fid)
6464
fid.close()
@@ -119,6 +119,7 @@ def test_mlist_errors(self):
119119
hdr = self.header_class.from_fileobj(fid)
120120
hdr['num_frames'] = 6
121121
mlist = read_mlist(fid, hdr.endianness)
122+
fid.close()
122123
mlist = np.array([[1.68427540e+07, 3.00000000e+00,
123124
1.20350000e+04, 1.00000000e+00],
124125
[1.68427530e+07, 1.20360000e+04,
@@ -156,6 +157,7 @@ class TestEcatSubHeader(TestCase):
156157
hdr = header_class.from_fileobj(fid)
157158
mlist = read_mlist(fid, hdr.endianness)
158159
subhdr = subhdr_class(hdr, mlist, fid)
160+
fid.close()
159161

160162
def test_subheader_size(self):
161163
assert self.subhdr_class._subhdrdtype.itemsize == 510

0 commit comments

Comments
 (0)