Skip to content

Commit

Permalink
Add more tests to test_eq_w_None (bug #1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierregm committed Oct 11, 2010
1 parent 75cebc1 commit 61d945b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>numpy-git</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
10 changes: 10 additions & 0 deletions .pydevproject
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>

<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/numpy-git/src</path>
</pydev_pathproperty>
</pydev_project>
14 changes: 12 additions & 2 deletions numpy/ma/tests/test_core.py
Expand Up @@ -101,8 +101,8 @@ def test_basic2d(self):
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)
Expand Down Expand Up @@ -1150,9 +1150,19 @@ def test_ne_on_structured(self):


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)

Expand Down

0 comments on commit 61d945b

Please sign in to comment.