From 9fa0dba63ac76a43a157e07c2a43f4678355653e Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sat, 24 Oct 2015 12:01:16 -0700 Subject: BUG: error in broadcast_arrays with as_strided array Fixes GH6491 --- numpy/lib/tests/test_stride_tricks.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'numpy/lib/tests/test_stride_tricks.py') diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py index aad0695be..06e659002 100644 --- a/numpy/lib/tests/test_stride_tricks.py +++ b/numpy/lib/tests/test_stride_tricks.py @@ -390,6 +390,14 @@ def test_writeable(): _, result = broadcast_arrays(0, original) assert_equal(result.flags.writeable, False) + # regresssion test for GH6491 + shape = (2,) + strides = [0] + tricky_array = as_strided(np.array(0), shape, strides) + other = np.zeros((1,)) + first, second = broadcast_arrays(tricky_array, other) + assert_(first.shape == second.shape) + def test_reference_types(): input_array = np.array('a', dtype=object) -- cgit v1.2.1