summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraypad.py
diff options
context:
space:
mode:
authorNathaniel J. Smith <njs@pobox.com>2017-08-24 16:24:33 -0700
committerGitHub <noreply@github.com>2017-08-24 16:24:33 -0700
commit01718a9feb7f949b091e4f95320c1a60116e77a5 (patch)
tree502d1bd7af28a8028f33284aff7cf5a4e476aa7c /numpy/lib/tests/test_arraypad.py
parent52a7efe1f2d0be6adb75d09babe6f203906ecfcb (diff)
parent6f9ea0abbd305d53f9017debab3a3a591fe0e249 (diff)
downloadnumpy-01718a9feb7f949b091e4f95320c1a60116e77a5.tar.gz
Merge pull request #9599 from irushchyshyn/pad-reflect-empty-array
BUG: fix infinite loop when creating np.pad on an empty array
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r--numpy/lib/tests/test_arraypad.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py
index 55cd24a14..a44722b56 100644
--- a/numpy/lib/tests/test_arraypad.py
+++ b/numpy/lib/tests/test_arraypad.py
@@ -1013,6 +1013,10 @@ class TestValueError1(object):
assert_raises(ValueError, pad, arr, ((-2, 3), (3, 2)),
**kwargs)
+ def test_check_empty_array(self):
+ assert_raises(ValueError, pad, [], 4, mode='reflect')
+ assert_raises(ValueError, pad, np.ndarray(0), 4, mode='reflect')
+
class TestValueError2(object):
def test_check_negative_pad_amount(self):