diff options
-rw-r--r-- | numpy/core/tests/test_memmap.py | 3 | ||||
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/tests/test_memmap.py b/numpy/core/tests/test_memmap.py index 2b8f276e3..d80724dea 100644 --- a/numpy/core/tests/test_memmap.py +++ b/numpy/core/tests/test_memmap.py @@ -14,6 +14,9 @@ class TestMemmap(TestCase): self.data = arange(12, dtype=self.dtype) self.data.resize(self.shape) + def tearDown(self): + self.tmpfp.close() + def test_roundtrip(self): # Write data to file fp = memmap(self.tmpfp, dtype=self.dtype, mode='w+', diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index ccfbe354c..d165fc293 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -1,5 +1,6 @@ import tempfile import sys +import os import numpy as np from numpy.testing import * from numpy.core import * @@ -832,6 +833,7 @@ class TestFromToFile(TestCase): tmp_file.flush() y = np.fromfile(tmp_file.name,dtype=self.dtype) assert_array_equal(y,self.x.flat) + tmp_file.close() def test_filename(self): filename = tempfile.mktemp() @@ -840,6 +842,7 @@ class TestFromToFile(TestCase): f.close() y = np.fromfile(filename,dtype=self.dtype) assert_array_equal(y,self.x.flat) + os.unlink(filename) def test_malformed(self): filename = tempfile.mktemp() @@ -848,6 +851,7 @@ class TestFromToFile(TestCase): f.close() y = np.fromfile(filename, sep=' ') assert_array_equal(y, [1.234, 1.]) + os.unlink(filename) class TestFromBuffer(TestCase): def tst_basic(self,buffer,expected,kwargs): |