summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_arraypad.py
diff options
context:
space:
mode:
authorMark Harfouche <mark.harfouche@gmail.com>2018-09-15 15:15:30 -0400
committerMark Harfouche <mark.harfouche@gmail.com>2018-09-15 15:15:30 -0400
commit09ea273d45d26f8d12d4b27c7851e1a4c7180b83 (patch)
treee68b883177e9eeb300ec98c6b3fe4cb261d48772 /numpy/lib/tests/test_arraypad.py
parent58da56876328e51473ebd4c5ce819262621d5278 (diff)
downloadnumpy-09ea273d45d26f8d12d4b27c7851e1a4c7180b83.tar.gz
MAINT: Add a test for np.pad where constant_values is an object
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r--numpy/lib/tests/test_arraypad.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py
index 45d624781..7318e9ef2 100644
--- a/numpy/lib/tests/test_arraypad.py
+++ b/numpy/lib/tests/test_arraypad.py
@@ -502,6 +502,16 @@ class TestConstant(object):
expected = np.full(7, int64_max, dtype=np.int64)
assert_array_equal(test, expected)
+ def test_check_object_array(self):
+ arr = np.empty(1, dtype=object)
+ obj = object()
+ arr = np.pad(arr, pad_width=1, mode='constant', constant_values=obj)
+
+ expected = np.empty((3, ), dtype=object)
+ expected[...] = obj
+ expected[1] = None
+
+ assert_array_equal(arr, expected)
class TestLinearRamp(object):
def test_check_simple(self):