Skip to content

Commit fb3bb8b

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 fb3bb8b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

nibabel/ecat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ def _get_oriented_data(self, raw_data, orientation=None):
611611
elif orientation == 'radiological':
612612
orientation = patient_orient_radiological[0]
613613
else:
614-
raise ValueError('orientation should be None,\
615-
neurological or radiological')
614+
raise ValueError('orientation should be None, '
615+
'neurological or radiological')
616616

617617
if orientation in patient_orient_neurological:
618618
raw_data = raw_data[::-1, ::-1, ::-1]

nibabel/tests/test_ecat.py

Lines changed: 2 additions & 1 deletion
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,

0 commit comments

Comments
 (0)