summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_index_tricks.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r--numpy/lib/tests/test_index_tricks.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index 0ede40d5a..43160ffb7 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -242,6 +242,16 @@ def test_ndindex():
expected = [ix for ix, e in np.ndenumerate(np.zeros((1, 2, 3)))]
assert_array_equal(x, expected)
+ x = list(np.ndindex((1, 2, 3)))
+ assert_array_equal(x, expected)
+
+ # Make sure size argument is optional
+ x = list(np.ndindex())
+ assert_equal(x, [()])
+
+ x = list(np.ndindex(()))
+ assert_equal(x, [()])
+
if __name__ == "__main__":
run_module_suite()