Skip to content

Commit 65cf4cf

Browse files
committed
Include RuntimeError in test_trivial_fancy_out_of_bounds testing
1 parent 90ad38e commit 65cf4cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch_np/tests/numpy_tests/core/test_indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ def test_trivial_fancy_out_of_bounds(self):
369369
ind = np.ones(20, dtype=np.intp)
370370
ind[-1] = 10
371371
assert_raises(IndexError, a.__getitem__, ind)
372-
assert_raises(IndexError, a.__setitem__, ind, 0)
372+
assert_raises((IndexError, RuntimeError), a.__setitem__, ind, 0)
373373
ind = np.ones(20, dtype=np.intp)
374374
ind[0] = 11
375375
assert_raises(IndexError, a.__getitem__, ind)
376-
assert_raises(IndexError, a.__setitem__, ind, 0)
376+
assert_raises((IndexError, RuntimeError), a.__setitem__, ind, 0)
377377

378378
def test_trivial_fancy_not_possible(self):
379379
# Test that the fast path for trivial assignment is not incorrectly

0 commit comments

Comments
 (0)