diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-09-01 10:17:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-01 10:17:00 -0700 |
commit | 11593aa176d491beb0cc5ffcc393956a5435a2bf (patch) | |
tree | ded5815ec56484d42d34e365386825a784a79b0d /numpy/lib/tests/test_arraypad.py | |
parent | c25f3827cf2226db257b3195d5c8b0b2e91ce5a4 (diff) | |
parent | b6bbd74bc1158a59eaa0c2e20fe2f66c52f07fb6 (diff) | |
download | numpy-11593aa176d491beb0cc5ffcc393956a5435a2bf.tar.gz |
Merge pull request #9640 from irushchyshyn/padding-an-empty-array
BUG: fix padding an empty array in reflect mode.
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r-- | numpy/lib/tests/test_arraypad.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py index a44722b56..fce4c451d 100644 --- a/numpy/lib/tests/test_arraypad.py +++ b/numpy/lib/tests/test_arraypad.py @@ -639,6 +639,11 @@ class TestReflect(object): b = np.array([1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3]) assert_array_equal(a, b) + def test_check_padding_an_empty_array(self): + a = pad(np.zeros((0, 3)), ((0,), (1,)), mode='reflect') + b = np.zeros((0, 5)) + assert_array_equal(a, b) + class TestSymmetric(object): def test_check_simple(self): @@ -1016,6 +1021,8 @@ class TestValueError1(object): def test_check_empty_array(self): assert_raises(ValueError, pad, [], 4, mode='reflect') assert_raises(ValueError, pad, np.ndarray(0), 4, mode='reflect') + assert_raises(ValueError, pad, np.zeros((0, 3)), ((1,), (0,)), + mode='reflect') class TestValueError2(object): |