Skip to content

Commit

Permalink
Update test_01_hickle_helpers.py
Browse files Browse the repository at this point in the history
More recent versions of h5py raise KeyError instead of OSError
  • Loading branch information
telegraphic authored Mar 30, 2024
1 parent 5cb9a0b commit fe92469
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hickle/tests/test_01_hickle_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ def test_H5NodeFilterProxy(h5_data):
# load data and try to directly modify 'type' and 'base_type' Attributes
# which will fail cause hdf5 file is opened for read only
h5_node = h5_data['somedata']
with pytest.raises(OSError):
with pytest.raises((KeyError, OSError)):
try:
h5_node.attrs['type'] = pickle.dumps(list)
except RuntimeError as re:
raise OSError(re).with_traceback(re.__traceback__)
with pytest.raises(OSError):
raise KeyError(re).with_traceback(re.__traceback__)
with pytest.raises((KeyError, OSError)):
try:
h5_node.attrs['base_type'] = b'list'
except RuntimeError as re:
raise OSError(re).with_traceback(re.__traceback__)
raise KeyError(re).with_traceback(re.__traceback__)

# verify that 'type' expands to tuple before running
# the remaining tests
Expand Down

0 comments on commit fe92469

Please sign in to comment.