I think this formatting reads a bit better:

```python
                # so that NaNs are equal
                np.testing.assert_equal(getattr(self, key, None),
                                        getattr(other, key, None))
```
don't forget the space after the `#`!