summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorNathaniel J. Smith <njs@pobox.com>2016-02-19 22:50:13 +0000
committerNathaniel J. Smith <njs@pobox.com>2016-02-19 22:50:13 +0000
commit6d3b34fed6d5c1af6eb02cd47d31ee48a15b582d (patch)
tree8342b011f1c7cd26286975ab8e51a1d8b6ad0c2a /numpy/lib/tests/test_function_base.py
parentbd905a8f0100a9cda21b1933676ef36ad213e879 (diff)
parented527cd7b28a76c8ecb2bd0e32a74a03767916bb (diff)
downloadnumpy-6d3b34fed6d5c1af6eb02cd47d31ee48a15b582d.tar.gz
Merge pull request #7274 from gfyoung/delete_copy_dtype
BUG: Preserve array order in np.delete
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 cd126fe71..782c1399a 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -533,6 +533,16 @@ class TestDelete(TestCase):
assert_(isinstance(delete(a, slice(1, 2)), SubClass))
assert_(isinstance(delete(a, slice(1, -2)), SubClass))
+ def test_array_order_preserve(self):
+ # See gh-7113
+ k = np.arange(10).reshape(2, 5, order='F')
+ m = delete(k, slice(60, None), axis=1)
+
+ # 'k' is Fortran ordered, and 'm' should have the
+ # same ordering as 'k' and NOT become C ordered
+ assert_equal(m.flags.c_contiguous, k.flags.c_contiguous)
+ assert_equal(m.flags.f_contiguous, k.flags.f_contiguous)
+
class TestGradient(TestCase):