diff options
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r-- | numpy/random/tests/test_random.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index a6783fe8f..37c1876bf 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -7,6 +7,8 @@ from numpy.testing import ( from numpy import random from numpy.compat import asbytes import sys +import warnings + class TestSeed(TestCase): def test_scalar(self): @@ -255,6 +257,20 @@ class TestRandomDist(TestCase): desired = np.iinfo('l').max np.testing.assert_equal(actual, desired) + def test_random_integers_deprecated(self): + with warnings.catch_warnings(): + warnings.simplefilter("error", DeprecationWarning) + + # DeprecationWarning raised with high == None + assert_raises(DeprecationWarning, + np.random.random_integers, + np.iinfo('l').max) + + # DeprecationWarning raised with high != None + assert_raises(DeprecationWarning, + np.random.random_integers, + np.iinfo('l').max, np.iinfo('l').max) + def test_random_sample(self): np.random.seed(self.seed) actual = np.random.random_sample((3, 2)) |