Skip to content

Commit

Permalink
Merge pull request #971 from jenshnielsen/close_test_file_v1_1_x
Browse files Browse the repository at this point in the history
Close fd temp file following rec2csv_bad_shape test
  • Loading branch information
mdboom committed Jul 2, 2012
2 parents 7e47149 + 8ee4c35 commit 2c85848
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/matplotlib/tests/test_mlab.py
Expand Up @@ -27,11 +27,14 @@ def test_recarray_csv_roundtrip():

@raises(ValueError)
def test_rec2csv_bad_shape():
bad = np.recarray((99,4),[('x',np.float),('y',np.float)])
fd = tempfile.TemporaryFile(suffix='csv')

# the bad recarray should trigger a ValueError for having ndim > 1.
mlab.rec2csv(bad,fd)
try:
bad = np.recarray((99,4),[('x',np.float),('y',np.float)])
fd = tempfile.TemporaryFile(suffix='csv')

# the bad recarray should trigger a ValueError for having ndim > 1.
mlab.rec2csv(bad,fd)
finally:
fd.close()

def test_prctile():
# test odd lengths
Expand Down

0 comments on commit 2c85848

Please sign in to comment.