diff options
author | Alistair Muldal <alimuldal@gmail.com> | 2016-10-30 20:04:59 +0000 |
---|---|---|
committer | Alistair Muldal <alimuldal@gmail.com> | 2016-11-02 23:29:04 +0000 |
commit | f5bb42f0b02fa954f03bf4d96801877a4837c8cb (patch) | |
tree | 88783e64b4e36240a0dc5ac773a430ae6476c4a4 /numpy/random/tests/test_random.py | |
parent | 6ae842001332f532e0c76815d49336ecc2b88dde (diff) | |
download | numpy-f5bb42f0b02fa954f03bf4d96801877a4837c8cb.tar.gz |
BUG: Better check for invalid bounds in np.random.uniform.
Also check for invalid bounds when low= and high= are arraylike rather than scalar (closes #8226)
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r-- | numpy/random/tests/test_random.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index 012bf4826..47301a770 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -809,6 +809,8 @@ class TestRandomDist(TestCase): assert_raises(OverflowError, func, -np.inf, 0) assert_raises(OverflowError, func, 0, np.inf) assert_raises(OverflowError, func, fmin, fmax) + assert_raises(OverflowError, func, [-np.inf], [0]) + assert_raises(OverflowError, func, [0], [np.inf]) # (fmax / 1e17) - fmin is within range, so this should not throw np.random.uniform(low=fmin, high=fmax / 1e17) |