Skip to content

Commit

Permalink
Merge pull request numpy#12176 from tylerjereddy/ravel_weights_test_err
Browse files Browse the repository at this point in the history
TST: add test for weighted histogram mismatch
  • Loading branch information
eric-wieser authored Oct 15, 2018
2 parents 2c4c93a + 0033161 commit ced77c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions numpy/lib/tests/test_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ def test_outliers(self):
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
Expand Down

0 comments on commit ced77c1

Please sign in to comment.