diff options
-rw-r--r-- | numpy/random/tests/test_random.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index a4aa75380..8acb0680e 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -1,4 +1,5 @@ -from numpy.testing import TestCase, run_module_suite, assert_ +from numpy.testing import TestCase, run_module_suite, assert_,\ + assert_raises from numpy import random import numpy as np @@ -318,6 +319,14 @@ class TestRandomDist(TestCase): [0, 0]]) np.testing.assert_array_equal(actual, desired) + def test_poisson_exceptions(self): + lambig = np.iinfo('l').max + lamneg = -1 + assert_raises(ValueError, np.random.poisson, lamneg) + assert_raises(ValueError, np.random.poisson, [lamneg]*10) + assert_raises(ValueError, np.random.poisson, lambig) + assert_raises(ValueError, np.random.poisson, [lambig]*10) + def test_power(self): np.random.seed(self.seed) actual = np.random.power(a =.123456789, size = (3, 2)) |