diff options
author | njsmith <njs@pobox.com> | 2013-01-15 13:19:31 -0800 |
---|---|---|
committer | njsmith <njs@pobox.com> | 2013-01-15 13:19:31 -0800 |
commit | ee6c66a2a71f46f02a823a8e107592ca3b76858e (patch) | |
tree | ad16ad0e5ea3073639b0b292941f0a8b211445c8 /numpy/lib/tests/test_index_tricks.py | |
parent | eb109d2bbea6e61c289907b9962d57c768eee28f (diff) | |
parent | d1a055b0cd5ad82106901a274d58563df4cd5070 (diff) | |
download | numpy-ee6c66a2a71f46f02a823a8e107592ca3b76858e.tar.gz |
Merge pull request #2897 from ContinuumIO/ndindex_fix
Fix for #2895 ndindex failing
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r-- | numpy/lib/tests/test_index_tricks.py | 10 |
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() |