Skip to content

Commit

Permalink
BUG la.close() crashes; closes #73
Browse files Browse the repository at this point in the history
  • Loading branch information
kwgoodman committed Jan 29, 2014
1 parent 0c132ce commit e263c9e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -120,9 +120,9 @@ After you have installed ``la``, run the suite of unit tests::
>>> import la
>>> la.test()
<snip>
Ran 3003 tests in 12.225s
Ran 3005 tests in 12.225s
OK
<nose.result.TextTestResult run=3003 errors=0 failures=0>
<nose.result.TextTestResult run=3005 errors=0 failures=0>

The ``la`` package contains C extensions that speed up common alignment
operations such as adding two unaligned larrys. If the C extensions don't
Expand Down
1 change: 1 addition & 0 deletions RELEASE.rst
Expand Up @@ -47,6 +47,7 @@ la 0.7
- #68 h5py prevents archiving of empty larrys
- #69, #70 Unit test failures on Windows
- #71 la.stack() Python 3.3 unit test failure
- #73 la.load() crashes due to typo

Older versions
==============
Expand Down
2 changes: 1 addition & 1 deletion la/io.py
Expand Up @@ -509,7 +509,7 @@ def load(file, key):
# Load larry
group = f[key]
x = group['x'][:]
label = _load_label(group, x.ndim)
label = _load_label(f, key)

# Close if file is a filename
if opened:
Expand Down
17 changes: 17 additions & 0 deletions la/tests/io_test.py
Expand Up @@ -192,6 +192,23 @@ def test_io_len(self):
io['y'] = y
self.assertTrue(len(io) == 2, 'number of keys is wrong')

def test_io_load_1(self):
"io.load_1"
d = larry([1,2,3])
la.save(self.filename, d, 'd')
a = la.load(self.filename, 'd')
assert_larry_equal(a, d)
la.io.delete(self.filename, 'd')

def test_io_load_2(self):
"io.load_2"
f = h5py.File(self.filename)
d = larry([1,2,3])
la.save(f, d, 'd')
a = la.load(f, 'd')
assert_larry_equal(a, d)
la.io.delete(f, 'd')

# nose tests ----------------------------------------------------------------

def datetime_test():
Expand Down

0 comments on commit e263c9e

Please sign in to comment.