summaryrefslogtreecommitdiff
path: root/numpy/testing
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-12-19 15:36:58 -0700
committerCharles Harris <charlesr.harris@gmail.com>2015-12-20 07:56:56 -0700
commitc4156cfbe9c22ab99473346b7757d2b54b46baa3 (patch)
tree9e7414fbbca8480e8743abfe58a17b895f1fa01d /numpy/testing
parent443184b12513ce2a8adcc2a81c143bc4bc697219 (diff)
downloadnumpy-c4156cfbe9c22ab99473346b7757d2b54b46baa3.tar.gz
MAINT: Use temppath in test_not_closing_opened_fid.
The test is in numpy/lib/tests/test_io.py. This commit is intended as a demonstration of using temppath.
Diffstat (limited to 'numpy/testing')
-rw-r--r--numpy/testing/tests/test_utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index b558270b3..23bd491bc 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -788,11 +788,13 @@ def test_tempdir():
pass
assert_(not os.path.isdir(tdir))
+ raised = False
try:
with tempdir() as tdir:
raise ValueError()
except ValueError:
- pass
+ raised = True
+ assert_(raised)
assert_(not os.path.isdir(tdir))
@@ -803,11 +805,13 @@ def test_temppath():
pass
assert_(not os.path.isfile(fpath))
+ raised = False
try:
with temppath() as fpath:
raise ValueError()
except ValueError:
- pass
+ raised = True
+ assert_(raised)
assert_(not os.path.isfile(fpath))