diff options
author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-18 13:50:15 -0700 |
---|---|---|
committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2018-10-18 13:50:15 -0700 |
commit | e712a4ecaedb9bb10897314dffa2dde01bf1183d (patch) | |
tree | d6f348ea537e1264ffd57a170ab78a8b6a081c0e /numpy/lib/tests/test_histograms.py | |
parent | 25a37a9c0a9b2cf0de0b221c53da92a8d34e92d5 (diff) | |
download | numpy-e712a4ecaedb9bb10897314dffa2dde01bf1183d.tar.gz |
TST: test invalid histogram range
Diffstat (limited to 'numpy/lib/tests/test_histograms.py')
-rw-r--r-- | numpy/lib/tests/test_histograms.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py index fa6ad989f..3840e7d98 100644 --- a/numpy/lib/tests/test_histograms.py +++ b/numpy/lib/tests/test_histograms.py @@ -249,6 +249,12 @@ class TestHistogram(object): assert_raises(ValueError, histogram, vals, range=[np.nan,0.75]) assert_raises(ValueError, histogram, vals, range=[0.25,np.inf]) + def test_invalid_range(self): + # start of range must be < end of range + vals = np.linspace(0.0, 1.0, num=100) + with assert_raises_regex(ValueError, "max must be larger than"): + np.histogram(vals, range=[0.1, 0.01]) + def test_bin_edge_cases(self): # Ensure that floating-point computations correctly place edge cases. arr = np.array([337, 404, 739, 806, 1007, 1811, 2012]) |