summaryrefslogtreecommitdiff
path: root/numpy/ma
diff options
context:
space:
mode:
authorpierregm <pierregmcode@gmail.com>2010-10-11 22:24:26 +0200
committerpierregm <pierregmcode@gmail.com>2010-10-11 22:24:26 +0200
commit61d945bdb5c9b2b3329e1b8468b5c7d0596dd9fc (patch)
tree0724cc0342ad8d0b3fc44c74970a26730e5fd001 /numpy/ma
parent75cebc1b71a161b18a45f291b97595c1f391ca46 (diff)
downloadnumpy-61d945bdb5c9b2b3329e1b8468b5c7d0596dd9fc.tar.gz
Add more tests to test_eq_w_None (bug #1493)
Diffstat (limited to 'numpy/ma')
-rw-r--r--numpy/ma/tests/test_core.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index f907a3447..5a8262e0d 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -101,8 +101,8 @@ class TestMaskedArray(TestCase):
self.assertTrue(isMaskedArray(xm))
assert_equal(shape(xm), s)
assert_equal(xm.shape, s)
- assert_equal(xm.size , reduce(lambda x, y:x * y, s))
- assert_equal(count(xm) , len(m1) - reduce(lambda x, y:x + y, m1))
+ assert_equal(xm.size, reduce(lambda x, y:x * y, s))
+ assert_equal(count(xm), len(m1) - reduce(lambda x, y:x + y, m1))
assert_equal(xm, xf)
assert_equal(filled(xm, 1.e20), xf)
assert_equal(x, xm)
@@ -1150,9 +1150,19 @@ class TestMaskedArrayArithmetic(TestCase):
def test_eq_w_None(self):
+ # With no mask
a = array([1, 2], mask=False)
assert_equal(a == None, False)
assert_equal(a != None, True)
+ # With a partial mask
+ a = array([1, 2], mask=[0, 1])
+ assert_equal(a == None, False)
+ assert_equal(a != None, True)
+ # With total mask
+ a = array([1, 2], mask=True)
+ assert_equal(a == None, False)
+ assert_equal(a != None, True)
+ # As masked
a = masked
assert_equal(a == None, masked)