summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_index_tricks.py
diff options
context:
space:
mode:
authorpsschand <psschand@gmail.com>2019-05-02 06:06:30 +0530
committerSebastian Berg <sebastian@sipsolutions.net>2019-05-01 17:36:30 -0700
commitf16c558fc3c3b57c4f2a93a80a778746ddd2f8ef (patch)
tree007abe37ea981545a5f4260b0207d2f2e30d2032 /numpy/lib/tests/test_index_tricks.py
parent3f85101de65fcb7b1ec258823ec28876dff1417f (diff)
downloadnumpy-f16c558fc3c3b57c4f2a93a80a778746ddd2f8ef.tar.gz
BUG: fix unravel_index when dimension is greater than 'intp'
The PR is: gh13439 Closes gh-9538
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r--numpy/lib/tests/test_index_tricks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index e687e2f54..2f7e97831 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -106,6 +106,9 @@ class TestRavelUnravelIndex(object):
np.ravel_multi_index(arr, (41, 7, 120, 36, 2706, 8, 6)),
[5627771580, 117259570957])
+ # test unravel_index for big indices (issue #9538)
+ assert_raises(ValueError, np.unravel_index, 1, (2**32-1, 2**31+1))
+
# test overflow checking for too big array (issue #7546)
dummy_arr = ([0],[0])
half_max = np.iinfo(np.intp).max // 2