summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_stride_tricks.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@climate.com>2015-03-01 14:23:07 -0800
committerStephan Hoyer <shoyer@climate.com>2015-03-01 14:29:58 -0800
commitd5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 (patch)
tree8f4c8c15dbebbd8bcba9406eeee9e2a2f6ead462 /numpy/lib/tests/test_stride_tricks.py
parent50e4eb87370b77792f1f6d21a5edd6ff20abee68 (diff)
downloadnumpy-d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3.tar.gz
BUG: fix broadcast_to for reference types
Diffstat (limited to 'numpy/lib/tests/test_stride_tricks.py')
-rw-r--r--numpy/lib/tests/test_stride_tricks.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py
index 0b73109bc..ef483921c 100644
--- a/numpy/lib/tests/test_stride_tricks.py
+++ b/numpy/lib/tests/test_stride_tricks.py
@@ -364,5 +364,15 @@ def test_writeable():
assert_equal(result.flags.writeable, False)
+def test_reference_types():
+ input_array = np.array('a', dtype=object)
+ expected = np.array(['a'] * 3, dtype=object)
+ actual = broadcast_to(input_array, (3,))
+ assert_array_equal(expected, actual)
+
+ actual, _ = broadcast_arrays(input_array, np.ones(3))
+ assert_array_equal(expected, actual)
+
+
if __name__ == "__main__":
run_module_suite()