Skip to content

Commit f29e335

Browse files
test_full_gh_1230 to be have differently dependending on NumPy version
For 2.0.0 and later, it is to raise OverflowError, otherwise it is expected to wrap up the out-of-bounds integral fill-in values given as Python scalars.
1 parent 83b704a commit f29e335

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,8 +1797,13 @@ def test_full_gh_1230(dt):
17971797
dtype = "i4"
17981798
dt_maxint = dpt.iinfo(dtype).max
17991799

1800-
with pytest.raises(OverflowError):
1801-
dpt.full(1, dt_maxint + 1, dtype=dtype, sycl_queue=q)
1800+
if np.lib.NumpyVersion(np.__version__) < "2.0.0":
1801+
X = dpt.full(1, fill_value=(dt_maxint + 1), dtype=dtype, sycl_queue=q)
1802+
Y = dpt.full_like(X, fill_value=dpt.iinfo(dtype).min)
1803+
assert dpt.all(X == Y)
1804+
else:
1805+
with pytest.raises(OverflowError):
1806+
dpt.full(1, dt_maxint + 1, dtype=dtype, sycl_queue=q)
18021807

18031808

18041809
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)