Skip to content

Commit 1c78c34

Browse files
authored
Merge pull request #401 from t20100/update-test
Updated tests
2 parents d192cd5 + 96305df commit 1c78c34

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ doc = [
4242
"sphinx_rtd_theme",
4343
]
4444
test = [
45-
"packaging",
4645
"numpy<2 ; python_version == '3.9'",
4746
"blosc2>=2.5.1",
4847
"blosc2-grok>=0.2.2",

src/hdf5plugin/test.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from typing import Any, cast
3535

3636
import numpy
37-
from packaging.version import parse as parse_version
3837

3938
import h5py
4039
import hdf5plugin
@@ -435,8 +434,8 @@ def setUp(self):
435434
numpy.array(["test", "strings", "ascii"] * N, dtype="S"),
436435
numpy.array([b"test", b"strings", b"binary"] * N, dtype="O"),
437436
]
438-
has_h5py_314 = parse_version(h5py.__version__) >= parse_version("3.14")
439-
has_numpy_2 = parse_version(numpy.__version__) >= parse_version("2.0")
437+
has_h5py_314 = h5py.version.version_tuple >= (3, 14)
438+
has_numpy_2 = numpy.__version__.startswith("2.")
440439
if has_h5py_314 and has_numpy_2:
441440
self.string_arrays.append(
442441
numpy.array(["test", "strings", "Crème brûlée"] * N, dtype="T")
@@ -494,13 +493,17 @@ def _test_strings(
494493
self.assertEqual(len(filters), 1)
495494
self.assertEqual(filters[0][0], hdf5plugin.FILTERS[filter_name])
496495

497-
@unittest.skip(reason="segfault (#364)")
496+
@unittest.skipIf(
497+
h5py.version.hdf5_version_tuple < (2, 1, 0), "hdf5 v2.1.0 required"
498+
)
498499
@unittest.skipUnless(should_test("blosc"), "Blosc filter not available")
499500
def testStringsBlosc(self):
500501
"""Strings write/read test with blosc filter plugin"""
501502
self._test_strings("blosc") # Default options
502503

503-
@unittest.skip(reason="segfault (#364)")
504+
@unittest.skipIf(
505+
h5py.version.hdf5_version_tuple < (2, 1, 0), "hdf5 v2.1.0 required"
506+
)
504507
@unittest.skipUnless(should_test("blosc2"), "Blosc filter not available")
505508
def testStringsBlosc2(self):
506509
"""Strings write/read test with blosc2 filter plugin"""

0 commit comments

Comments
 (0)