It appears that ```assertArrayAlmostEqual``` is not quite what's needed here. More specifically ```np.testing.assert_array_almost_equal``` (and ```np.testing.assert_array_equal``` ) which is called underneath only pays attention to unmasked values when doing the comparison. For example:
```python
a = np.array([0, 1, 2])
b = ma.masked_array([0, 20, 2], mask=[0, 1, 0])
np.testing.assert_array_equal(a, b)
```
does not raise an error. This means that while the test will verify the unmasked values are correct, it does not test that the resulting mask is correct. Perhaps we need an ```assertMaskedArrayAlmostEqual```. FYI the mask is checked by your use of the ```assertCML``` method which calculates a checksum for the data array and its mask. However, given the data is floating point and you are checking it manually I suggest you pass in ```checksum=False``` to the ```assertCML()``` call.