summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_twodim_base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index cce683bfe..c1c5a1615 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -18,6 +18,9 @@ import numpy as np
from numpy.core.tests.test_overrides import requires_array_function
+import pytest
+
+
def get_mat(n):
data = arange(n)
data = add.outer(data, data)
@@ -295,6 +298,13 @@ class TestHistogram2d:
r = histogram2d(xy, xy, weights=s_d)
assert_(r, ((ShouldDispatch,), (xy, xy), dict(weights=s_d)))
+ @pytest.mark.parametrize(("x_len", "y_len"), [(10, 11), (20, 19)])
+ def test_bad_length(self, x_len, y_len):
+ x, y = np.ones(x_len), np.ones(y_len)
+ with pytest.raises(ValueError,
+ match='x and y must have the same length.'):
+ histogram2d(x, y)
+
class TestTri:
def test_dtype(self):