From 8b54222dbd5890df1480d769a51f1f8541f9a06f Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 13 Aug 2008 17:23:25 +0000 Subject: Unique1d will now return unique as well as reverse indices. Fix order of returns [patch by Robert Cimrman]. --- numpy/lib/tests/test_arraysetops.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'numpy/lib/tests/test_arraysetops.py') diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py index 474842c8a..c40cf9d20 100644 --- a/numpy/lib/tests/test_arraysetops.py +++ b/numpy/lib/tests/test_arraysetops.py @@ -6,6 +6,8 @@ from numpy.testing import * import numpy as np from numpy.lib.arraysetops import * +import warnings + class TestAso(TestCase): def test_unique1d( self ): a = np.array( [5, 7, 1, 2, 1, 5, 7] ) @@ -14,11 +16,13 @@ class TestAso(TestCase): c = unique1d( a ) assert_array_equal( c, ec ) - d, c = unique1d( a, True ) - ed = np.array( [2, 3, 0, 1] ) + warnings.simplefilter('ignore', Warning) + unique, indices = unique1d( a, return_index=True ) + warnings.resetwarnings() - assert_array_equal( d,ed ) - assert_array_equal( c, ec ) + ed = np.array( [2, 3, 0, 1] ) + assert_array_equal(unique, ec) + assert_array_equal(indices, ed) assert_array_equal([], unique1d([])) -- cgit v1.2.1