summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-02-13 21:02:06 +0000
committerEric Wieser <wieser.eric@gmail.com>2017-02-13 21:09:04 +0000
commitd932fcd38d9ef0f76c988d6c197856fa0c71314b (patch)
tree5ef0d0caa7daedc7759c18fb5cd8d78ef46fec58 /numpy/lib/tests/test_function_base.py
parentee40ff69127fee94e7e3103445729024e7b3de21 (diff)
downloadnumpy-d932fcd38d9ef0f76c988d6c197856fa0c71314b.tar.gz
BUG: Copy meshgrid after broadcasting, fixing #8561
Also, remove some unused variables
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 5c2446e50..f69c24d59 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -2266,6 +2266,16 @@ class TestMeshgrid(TestCase):
assert_(X.dtype == x.dtype)
assert_(Y.dtype == y.dtype)
+ def test_writeback(self):
+ # Issue 8561
+ X = np.array([1.1, 2.2])
+ Y = np.array([3.3, 4.4])
+ x, y = np.meshgrid(X, Y, sparse=False, copy=True)
+
+ x[0, :] = 0
+ assert_equal(x[0, :], 0)
+ assert_equal(x[1, :], X)
+
class TestPiecewise(TestCase):