diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-06-27 13:01:54 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-06-27 13:01:54 +0100 |
commit | f178f270a8cc4ba42267f2126f56c318eb4833d9 (patch) | |
tree | 27f7ebfacda9d4f00ff8cfdf40e20193084e7397 | |
parent | 715daa97ad716da52ada07eb10cc37b314428311 (diff) | |
download | numpy-f178f270a8cc4ba42267f2126f56c318eb4833d9.tar.gz |
MAINT: Better names in ma.sort test
-rw-r--r-- | numpy/ma/tests/test_core.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 26099455d..a44f765e3 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -3106,27 +3106,27 @@ class TestMaskedArrayMethods(TestCase): assert_equal(am, an) def test_sort_flexible(self): - # Test sort on flexible dtype. + # Test sort on structured dtype. a = array( data=[(3, 3), (3, 2), (2, 2), (2, 1), (1, 0), (1, 1), (1, 2)], mask=[(0, 0), (0, 1), (0, 0), (0, 0), (1, 0), (0, 0), (0, 0)], dtype=[('A', int), ('B', int)]) - - test = sort(a) - b = array( + mask_last = array( data=[(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 2), (1, 0)], mask=[(0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 1), (1, 0)], dtype=[('A', int), ('B', int)]) - assert_equal(test, b) - assert_equal(test.mask, b.mask) + mask_first = array( + data=[(1, 0), (1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3)], + mask=[(1, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 1), (0, 0)], + dtype=[('A', int), ('B', int)]) + + test = sort(a) + assert_equal(test, mask_last) + assert_equal(test.mask, mask_last.mask) test = sort(a, endwith=False) - b = array( - data=[(1, 0), (1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3), ], - mask=[(1, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 1), (0, 0), ], - dtype=[('A', int), ('B', int)]) - assert_equal(test, b) - assert_equal(test.mask, b.mask) + assert_equal(test, mask_first) + assert_equal(test.mask, mask_first.mask) def test_argsort(self): # Test argsort |