Skip to content

Commit 9fcca48

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

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/test_mathematical.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,13 @@ 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 exp_dt == numpy.int64
1299+
and numpy.dtype("l") != numpy.int64
1300+
):
1301+
pytest.skip("numpy.ldexp doesn't have a loop for the input types")
1302+
12961303
mant = numpy.array(2.0, dtype=mant_dt)
12971304
exp = numpy.array(3, dtype=exp_dt)
12981305
imant, iexp = dpnp.array(mant), dpnp.array(exp)

tests/test_umath.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,18 @@ 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[1].dtype == numpy.int64
111+
and numpy.dtype("l") != numpy.int64
112+
):
113+
pytest.skip("numpy.ldexp doesn't have a loop for the input types")
104114

105115
# original
106116
expected = getattr(numpy, umath)(*args)

0 commit comments

Comments
 (0)