summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-10-14 21:33:35 -0700
committerGitHub <noreply@github.com>2018-10-14 21:33:35 -0700
commitced77c1f06b2712e4a772fc519092d3dc0bf4d5a (patch)
tree8c620b1f0e2dedcba04cfd77c6f13e50c3e3b049 /numpy/lib/tests
parent2c4c93af0b2d20d85a7432093f31318cbf3c457f (diff)
parent0033161ec65311c600dffc6d7af8daf4116b760f (diff)
downloadnumpy-ced77c1f06b2712e4a772fc519092d3dc0bf4d5a.tar.gz
Merge pull request #12176 from tylerjereddy/ravel_weights_test_err
TST: add test for weighted histogram mismatch
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_histograms.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py
index a71060a46..fa6ad989f 100644
--- a/numpy/lib/tests/test_histograms.py
+++ b/numpy/lib/tests/test_histograms.py
@@ -119,6 +119,13 @@ class TestHistogram(object):
h, b = histogram(a, bins=8, range=[1, 9], weights=w)
assert_equal(h, w[1:-1])
+ def test_arr_weights_mismatch(self):
+ a = np.arange(10) + .5
+ w = np.arange(11) + .5
+ with assert_raises_regex(ValueError, "same shape as"):
+ h, b = histogram(a, range=[1, 9], weights=w, density=True)
+
+
def test_type(self):
# Check the type of the returned histogram
a = np.arange(10) + .5