Skip to content

Commit 341867a

Browse files
committed
Mute tests with unsupported loop for numpy.ldexp
1 parent ce507b1 commit 341867a

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

tests/test_mathematical.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,14 @@ class TestLdexp:
12931293
@pytest.mark.parametrize("mant_dt", get_float_dtypes())
12941294
@pytest.mark.parametrize("exp_dt", get_integer_dtypes())
12951295
def test_basic(self, mant_dt, exp_dt):
1296+
if (
1297+
numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0"
1298+
and mant_dt == numpy.float32
1299+
and exp_dt == numpy.int64
1300+
and numpy.dtype("l") != numpy.int64
1301+
):
1302+
pytest.skip("numpy.ldexp doesn't have a loop for the input types")
1303+
12961304
mant = numpy.array(2.0, dtype=mant_dt)
12971305
exp = numpy.array(3, dtype=exp_dt)
12981306
imant, iexp = dpnp.array(mant), dpnp.array(exp)

tests/test_umath.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,19 @@ def test_umaths(test_cases):
9999
args = get_args(args_str, sh, xp=numpy)
100100
iargs = get_args(args_str, sh, xp=dpnp)
101101

102-
if umath == "reciprocal" and args[0].dtype in [numpy.int32, numpy.int64]:
103-
pytest.skip("For integer input array, numpy.reciprocal returns zero.")
102+
if umath == "reciprocal":
103+
if args[0].dtype in [numpy.int32, numpy.int64]:
104+
pytest.skip(
105+
"For integer input array, numpy.reciprocal returns zero."
106+
)
107+
elif umath == "ldexp":
108+
if (
109+
numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0"
110+
and args[0].dtype == numpy.float32
111+
and args[1].dtype == numpy.int64
112+
and numpy.dtype("l") != numpy.int64
113+
):
114+
pytest.skip("numpy.ldexp doesn't have a loop for the input types")
104115

105116
# original
106117
expected = getattr(numpy, umath)(*args)

0 commit comments

Comments
 (0)