Skip to content

Commit e5fd923

Browse files
committed
BF: need to delete temporary image for windows
Windows throwing error when trying to delete temporary directory, probabably because the image object is holding onto a reference to the file.
1 parent e7075bf commit e5fd923

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nibabel/tests/test_ecat.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,13 @@ def test_file(self):
201201

202202
def test_save(self):
203203
tmp_file = 'tinypet_tmp.v'
204-
with InTemporaryDirectory() as tmp_dir:
204+
with InTemporaryDirectory():
205205
self.img.to_filename(tmp_file)
206206
other = self.image_class.load(tmp_file)
207207
assert_equal(self.img.get_data().all(), other.get_data().all())
208+
# Delete object holding reference to temporary file to make Windows
209+
# happier.
210+
del other
208211

209212
def test_data(self):
210213
dat = self.img.get_data()

0 commit comments

Comments
 (0)