Skip to content

Commit 6ef86be

Browse files
Improve code coverage
1 parent 3d205fd commit 6ef86be

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

dpnp/tests/test_mathematical.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,23 @@ def test_left_right_args(self, dtype):
11971197
result = dpnp.interp(ix, ixp, ifp, left=-40, right=40)
11981198
assert_dtype_allclose(result, expected)
11991199

1200+
# left and right as ndarray
1201+
expected = numpy.interp(
1202+
x,
1203+
xp,
1204+
fp,
1205+
left=numpy.array(-40, dtype=dtype),
1206+
right=numpy.array(40, dtype=dtype),
1207+
)
1208+
result = dpnp.interp(
1209+
ix,
1210+
ixp,
1211+
ifp,
1212+
left=dpnp.array(-40, dtype=dtype),
1213+
right=dpnp.array(40, dtype=dtype),
1214+
)
1215+
assert_dtype_allclose(result, expected)
1216+
12001217
@pytest.mark.parametrize("val", [numpy.nan, numpy.inf, -numpy.inf])
12011218
def test_naninf(self, val):
12021219
x = numpy.array([0, 1, 2, val])

0 commit comments

Comments
 (0)