You shouldn't compare to `nan` really. Doing `self.assertTrue(np.isnan(collapsed_cube.data).all())` is probably more appropriate (or something along those lines that  uses `isnan` anyway).