Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc60d14

Browse files
committed
Fix test requiring numpy>=1.11
1 parent 3b49208 commit bc60d14

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

h5py/tests/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,5 @@ def assertNumpyBehavior(self, dset, arr, s):
162162
else:
163163
with self.assertRaises(exc):
164164
dset[s]
165+
166+
NUMPY_RELEASE_VERSION = tuple([int(i) for i in np.__version__.split(".")[0:2]])

h5py/tests/hl/test_datatype.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import h5py
99

10-
from ..common import ut, TestCase
10+
from ..common import ut, TestCase, NUMPY_RELEASE_VERSION
1111

1212
class TestVlen(TestCase):
1313

@@ -44,6 +44,7 @@ def test_vlen_enum(self):
4444
self.assertEqual(h5py.check_dtype(enum=h5py.check_dtype(vlen=dt1)),
4545
h5py.check_dtype(enum=h5py.check_dtype(vlen=dt2)))
4646

47+
@ut.skipIf(NUMPY_RELEASE_VERSION < (1, 11), "Requires numpy>=1.11")
4748
class TestAligned(TestCase):
4849

4950
"""

0 commit comments

Comments
 (0)