summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraypad.py
diff options
context:
space:
mode:
authorJostein Bø Fløystad <jostein.floystad@gmail.com>2013-07-05 18:17:26 +0200
committerJostein Bø Fløystad <jostein.floystad@gmail.com>2013-07-05 18:17:26 +0200
commitea45134062693723c2258b862f87d3750a8dc564 (patch)
tree40235b44f26aaf9babd608a6c1ea361f17d5cebf /numpy/lib/tests/test_arraypad.py
parentc6ce294f6feeebcdf67b238564c770387be933a5 (diff)
downloadnumpy-ea45134062693723c2258b862f87d3750a8dc564.tar.gz
TST: New test to ensure np.pad allows pad_width of zero.
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r--numpy/lib/tests/test_arraypad.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py
index c6acd4db0..ec96f5c8c 100644
--- a/numpy/lib/tests/test_arraypad.py
+++ b/numpy/lib/tests/test_arraypad.py
@@ -486,6 +486,14 @@ class TestEdge(TestCase):
assert_array_equal(a, b)
+class TestZeroPadWidth(TestCase):
+ def test_zero_pad_width(self):
+ arr = np.arange(30)
+ arr = np.reshape(arr, (6, 5))
+ for pad_width in (0, (0, 0), ((0, 0), (0, 0))):
+ assert_array_equal(arr, pad(arr, pad_width, mode='constant'))
+
+
class ValueError1(TestCase):
def test_check_simple(self):
arr = np.arange(30)