Skip to content

Commit 5e6271d

Browse files
Be forgiving for test_fill_gh_1230 with older numpy versions
1 parent 04f8a4c commit 5e6271d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,10 @@ def test_full_gh_1230(dt):
17981798
dt_maxint = dpt.iinfo(dtype).max
17991799

18001800
if (dtype.itemsize < 8) and (np.lib.NumpyVersion(np.__version__) < "2.0.0"):
1801-
X = dpt.full(1, fill_value=(dt_maxint + 1), dtype=dt)
1801+
try:
1802+
X = dpt.full(1, fill_value=(dt_maxint + 1), dtype=dt)
1803+
except OverflowError:
1804+
pytest.skip("Expected OverflowError raised")
18021805
Y = dpt.full_like(X, fill_value=dpt.iinfo(dt).min)
18031806
assert dpt.all(X == Y)
18041807
else:

0 commit comments

Comments
 (0)