summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorDanny Hermes <daniel.j.hermes@gmail.com>2017-11-12 11:17:12 -0800
committerEric Wieser <wieser.eric@gmail.com>2017-11-12 11:17:12 -0800
commita4e47e0205b78eb96248e71918c2558e25a9d3c7 (patch)
tree85f60a4994556e0eaf8e2fd0d4d72e2cf66ea5b7 /numpy/lib/tests
parentd87c4197c358a898372c178f6c24f00d54eff745 (diff)
downloadnumpy-a4e47e0205b78eb96248e71918c2558e25a9d3c7.tar.gz
ENH: Add `order=` keyword to `np.eye()` (#9996)
Fixes #9995
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_twodim_base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index 6bf668dee..8183f7ca6 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -95,6 +95,15 @@ class TestEye(object):
def test_bool(self):
assert_equal(eye(2, 2, dtype=bool), [[True, False], [False, True]])
+ def test_order(self):
+ mat_c = eye(4, 3, k=-1)
+ mat_f = eye(4, 3, k=-1, order='F')
+ assert_equal(mat_c, mat_f)
+ assert mat_c.flags.c_contiguous
+ assert not mat_c.flags.f_contiguous
+ assert not mat_f.flags.c_contiguous
+ assert mat_f.flags.f_contiguous
+
class TestDiag(object):
def test_vector(self):