'Test that a 3x3 unit kernel returns the same array (except when
boundary is None). This version includes a NaN value in the original
array.'

@pytest.mark.parametrize(u'boundary', BOUNDARY_OPTIONS)
def test_unity_3x3_withnan(self, boundary):

    x = np.array([[1.0, 2.0, 3.0], [4.0, np.nan, 6.0], [7.0, 8.0, 9.0]], dtype=u'>f8')
    y = np.array([[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 0.0]], dtype=u'>f8')
    z = convolve(x, y, boundary=boundary, nan_treatment=u'fill', preserve_nan=True)
    assert np.isnan(z[(1, 1)])
    x = np.nan_to_num(z)
    z = np.nan_to_num(z)
    if (boundary is None):
        assert np.all((z == np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], dtype=u'>f8')))
    else:
        assert np.all((z == x))
