Skip to content

Commit d20388b

Browse files
authored
Merge pull request #583 from matthew-brett/mac-precision-fix
MRG: skip precision test on macOS, newer numpy
2 parents 0d02553 + ee7183e commit d20388b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nibabel/tests/test_floating.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
PY2 = sys.version_info[0] < 3
66

7+
from distutils.version import LooseVersion
8+
79
import numpy as np
810

911
from ..casting import (floor_exact, ceil_exact, as_int, FloatingError,
@@ -103,7 +105,12 @@ def test_check_nmant_nexp():
103105
ti = type_info(t)
104106
if ti['nmant'] != 106: # This check does not work for PPC double pair
105107
assert_true(_check_nmant(t, ti['nmant']))
106-
assert_true(_check_maxexp(t, ti['maxexp']))
108+
# Test fails for longdouble after blacklisting of OSX powl as of numpy
109+
# 1.12 - see https://github.com/numpy/numpy/issues/8307
110+
if (t != np.longdouble or
111+
sys.platform != 'darwin' or
112+
LooseVersion(np.__version__) < LooseVersion('1.12')):
113+
assert_true(_check_maxexp(t, ti['maxexp']))
107114

108115

109116
def test_as_int():

0 commit comments

Comments
 (0)