Skip to content

Commit

Permalink
Merge pull request h5py#1873 from mgorny/np-types-x86
Browse files Browse the repository at this point in the history
TST: Fix skipping unsupported x86 datatypes with newer versions of numpy
  • Loading branch information
aragilar authored Apr 12, 2021
2 parents 0589e69 + ae877ab commit 514deb9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions h5py/tests/test_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from .common import ut, TestCase

UNSUPPORTED_LONG_DOUBLE = ('i386', 'i486', 'i586', 'i686', 'ppc64le')
UNSUPPORTED_LONG_DOUBLE_TYPES = ('float96', 'float128', 'complex192',
'complex256')


class TestVlen(TestCase):
Expand Down Expand Up @@ -289,13 +291,14 @@ def test_float_round_tripping(self):
if (np.issubdtype(f, np.floating) or
np.issubdtype(f, np.complexfloating)))

unsupported_types = []
if platform.machine() in UNSUPPORTED_LONG_DOUBLE:
dtype_dset_map = {str(j): d
for j, d in enumerate(dtypes)
if d not in (np.float128, np.complex256)}
else:
dtype_dset_map = {str(j): d
for j, d in enumerate(dtypes)}
for x in UNSUPPORTED_LONG_DOUBLE_TYPES:
if hasattr(np, x):
unsupported_types.append(getattr(np, x))
dtype_dset_map = {str(j): d
for j, d in enumerate(dtypes)
if d not in unsupported_types}

fname = self.mktemp()

Expand Down

0 comments on commit 514deb9

Please sign in to comment.