Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support h5py version 3.9+ #181

Merged
merged 2 commits into from
Mar 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 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,17 @@ 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((KeyError, OSError)):
pytest_errclass = KeyError if h5py.__version__ >= '3.9.0' else OSError
with pytest.raises(pytest_errclass):
try:
h5_node.attrs['type'] = pickle.dumps(list)
except RuntimeError as re:
raise KeyError(re).with_traceback(re.__traceback__)
with pytest.raises((KeyError, OSError)):
raise pytest_errclass(re).with_traceback(re.__traceback__)
with pytest.raises(pytest_errclass):
try:
h5_node.attrs['base_type'] = b'list'
except RuntimeError as re:
raise KeyError(re).with_traceback(re.__traceback__)
raise pytest_errclass(re).with_traceback(re.__traceback__)

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