summaryrefslogtreecommitdiff
path: root/numpy/random/tests
diff options
context:
space:
mode:
authorKevin Sheppard <kevin.k.sheppard@gmail.com>2019-04-15 17:49:31 +0100
committermattip <matti.picus@gmail.com>2019-05-20 18:50:41 +0300
commitca9c542d24d418b4a203255f3a390c6b7fee4b51 (patch)
treef6bceff97983d2c9f25b07f698f0af58c0dd337e /numpy/random/tests
parent4f06779070d3c87122725a69ac9d3f75440f3fad (diff)
downloadnumpy-ca9c542d24d418b4a203255f3a390c6b7fee4b51.tar.gz
BUG: Cast high to Python int to avoid overflow
Case high to a Python int to avoid overflow from NumPy types
Diffstat (limited to 'numpy/random/tests')
-rw-r--r--numpy/random/tests/test_randomstate.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/random/tests/test_randomstate.py b/numpy/random/tests/test_randomstate.py
index 8d10823d6..50f226386 100644
--- a/numpy/random/tests/test_randomstate.py
+++ b/numpy/random/tests/test_randomstate.py
@@ -436,6 +436,14 @@ class TestRandomDist(object):
desired = np.iinfo('l').max
assert_equal(actual, desired)
+ with suppress_warnings() as sup:
+ w = sup.record(DeprecationWarning)
+ typer = np.dtype('l').type
+ actual = random.random_integers(typer(np.iinfo('l').max),
+ typer(np.iinfo('l').max))
+ assert_(len(w) == 1)
+ assert_equal(actual, desired)
+
def test_random_integers_deprecated(self):
with warnings.catch_warnings():