summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2010-06-29 17:57:15 +0000
committerpierregm <pierregm@localhost>2010-06-29 17:57:15 +0000
commit0a95b13f36932bafb8bbb0d7c32b0895f50f562e (patch)
treeccdda1d12c0ce774d23ec2f9b5cc8ef6074f52f1 /numpy/ma/tests
parent9b86617974fee246df0ebba859102897f531f659 (diff)
downloadnumpy-0a95b13f36932bafb8bbb0d7c32b0895f50f562e.tar.gz
Fixed __eq__/__ne__ for scalars
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index f95d621db..908d7adc6 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -1149,6 +1149,21 @@ class TestMaskedArrayArithmetic(TestCase):
assert_equal(test.mask, [False, False])
+ def test_eq_w_None(self):
+ a = array([1, 2], mask=False)
+ assert_equal(a == None, False)
+ assert_equal(a != None, True)
+ a = masked
+ assert_equal(a == None, masked)
+
+ def test_eq_w_scalar(self):
+ a = array(1)
+ assert_equal(a == 1, True)
+ assert_equal(a == 0, False)
+ assert_equal(a != 1, False)
+ assert_equal(a != 0, True)
+
+
def test_numpyarithmetics(self):
"Check that the mask is not back-propagated when using numpy functions"
a = masked_array([-1, 0, 1, 2, 3], mask=[0, 0, 0, 0, 1])