summaryrefslogtreecommitdiff
path: root/numpy/core/tests
diff options
context:
space:
mode:
authorDoug Davis <ddavis@ddavis.io>2019-11-06 15:15:40 -0500
committerMatti Picus <matti.picus@gmail.com>2019-11-06 13:15:40 -0700
commit480dc6bc01aa465389fcad0c85502d25d954f579 (patch)
tree209b80007844759937e8ea068884e77d17dd793d /numpy/core/tests
parent8e603c7f8dff17e2648a788e032bdc59eba1d673 (diff)
downloadnumpy-480dc6bc01aa465389fcad0c85502d25d954f579.tar.gz
BUG: raise ValueError for empty arrays passed to _pyarray_correlate (#14829)
* BUG: raise ValueError for empty arrays passed to _pyarray_correlate This is related to GitHub issue #14366 where empty arrays were causing crashes.
Diffstat (limited to 'numpy/core/tests')
-rw-r--r--numpy/core/tests/test_numeric.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
index 1358b45e9..4d322e50e 100644
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -2567,6 +2567,11 @@ class TestCorrelate(object):
z = np.correlate(y, x, mode='full')
assert_array_almost_equal(z, r_z)
+ def test_zero_size(self):
+ with pytest.raises(ValueError):
+ np.correlate(np.array([]), np.ones(1000), mode='full')
+ with pytest.raises(ValueError):
+ np.correlate(np.ones(1000), np.array([]), mode='full')
class TestConvolve(object):
def test_object(self):