(self, add)
| 5576 | |
| 5577 | class TestMaskedConstant: |
| 5578 | def _do_add_test(self, add): |
| 5579 | # sanity check |
| 5580 | assert_(add(np.ma.masked, 1) is np.ma.masked) |
| 5581 | |
| 5582 | # now try with a vector |
| 5583 | vector = np.array([1, 2, 3]) |
| 5584 | result = add(np.ma.masked, vector) |
| 5585 | |
| 5586 | # lots of things could go wrong here |
| 5587 | assert_(result is not np.ma.masked) |
| 5588 | assert_(not isinstance(result, np.ma.core.MaskedConstant)) |
| 5589 | assert_equal(result.shape, vector.shape) |
| 5590 | assert_equal(np.ma.getmask(result), np.ones(vector.shape, dtype=bool)) |
| 5591 | |
| 5592 | def test_ufunc(self): |
| 5593 | self._do_add_test(np.add) |
no test coverage detected