diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-03-30 21:54:46 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-03-30 21:54:46 +0000 |
commit | a4c5e55aa74ca1ac28b0451d0e092991b8d6abca (patch) | |
tree | bb0f064178594be2f1d8c25cf0453ff04a1916ec /numpy/lib/tests/test_recfunctions.py | |
parent | cdf6562c5552369e363d9811bf45f5ab15f0ff80 (diff) | |
download | numpy-a4c5e55aa74ca1ac28b0451d0e092991b8d6abca.tar.gz |
Fixed #1039: ignore sort order properly in find_duplicates test
Diffstat (limited to 'numpy/lib/tests/test_recfunctions.py')
-rw-r--r-- | numpy/lib/tests/test_recfunctions.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index 48a815d35..c261b9ebe 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -137,8 +137,6 @@ class TestRecFunctions(TestCase): 'BBA': ['B', 'BB'], 'BBB': ['B', 'BB']} assert_equal(test, control) - - #@np.testing.dec.knownfailureif(sys.platform=='win32', "Fail on Win32") def test_find_duplicates(self): "Test find_duplicates" a = ma.array([(2, (2., 'B')), (1, (2., 'B')), (2, (2., 'B')), @@ -160,20 +158,18 @@ class TestRecFunctions(TestCase): test = find_duplicates(a, key='B', return_index=True) control = [0, 1, 2, 4] assert_equal(sorted(test[-1]), control) - assert_equal(test[0], a[control]) + assert_equal(test[0], a[test[-1]]) # test = find_duplicates(a, key='BA', return_index=True) control = [0, 1, 2, 4] assert_equal(sorted(test[-1]), control) - assert_equal(test[0], a[control]) + assert_equal(test[0], a[test[-1]]) # test = find_duplicates(a, key='BB', return_index=True) control = [0, 1, 2, 3, 4] assert_equal(sorted(test[-1]), control) - assert_equal(test[0], a[control]) - + assert_equal(test[0], a[test[-1]]) - #@np.testing.dec.knownfailureif(sys.platform=='win32', "Fail on Win32") def test_find_duplicates_ignoremask(self): "Test the ignoremask option of find_duplicates" ndtype = [('a', int)] @@ -187,7 +183,7 @@ class TestRecFunctions(TestCase): test = find_duplicates(a, ignoremask=False, return_index=True) control = [0, 1, 2, 3, 4, 6] assert_equal(sorted(test[-1]), control) - assert_equal(test[0], a[control]) + assert_equal(test[0], a[test[-1]]) class TestRecursiveFillFields(TestCase): |