diff options
author | Han Genuit <hangenuit@gmail.com> | 2012-09-15 17:47:22 +0200 |
---|---|---|
committer | Han Genuit <hangenuit@gmail.com> | 2012-09-15 17:55:46 +0200 |
commit | 7c183a5d03ae31a6369cdcc608b4e4fabf83484f (patch) | |
tree | 2b2ccc81f84584c98662b5fa5e4fd93b57bd2911 /numpy | |
parent | 027c3d91b6b5bbc0f7e50cce8a39da439e165d39 (diff) | |
download | numpy-7c183a5d03ae31a6369cdcc608b4e4fabf83484f.tar.gz |
TST: Add test for concatenate with None-axis
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_shape_base.py | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py index 17a9cbbde..2017ca7a3 100644 --- a/numpy/core/tests/test_shape_base.py +++ b/numpy/core/tests/test_shape_base.py @@ -1,6 +1,9 @@ -from numpy.testing import * -from numpy.core import array, atleast_1d, atleast_2d, atleast_3d, vstack, \ - hstack, newaxis +import warnings +import numpy as np +from numpy.testing import (TestCase, assert_, assert_raises, assert_equal, + assert_array_equal, run_module_suite) +from numpy.core import (array, arange, atleast_1d, atleast_2d, atleast_3d, + vstack, hstack, newaxis, concatenate) class TestAtleast1d(TestCase): def test_0D_array(self): @@ -141,5 +144,20 @@ class TestVstack(TestCase): desired = array([[1,2],[1,2]]) assert_array_equal(res,desired) +def test_concatenate_axis_None(): + a = np.arange(4, dtype=np.float64).reshape((2,2)) + b = range(3) + c = ['x'] + r = np.concatenate((a, a), axis=None) + assert_equal(r.dtype, a.dtype) + assert_equal(r.ndim, 1) + r = np.concatenate((a, b), axis=None) + assert_equal(r.size, a.size + len(b)) + assert_equal(r.dtype, a.dtype) + r = np.concatenate((a, b, c), axis=None) + d = array(['0', '1', '2', '3', + '0', '1', '2', 'x']) + assert_array_equal(r,d) + if __name__ == "__main__": run_module_suite() |