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

@pytest.mark.parametrize((u'boundary', u'nan_treatment', u'normalize_kernel', u'preserve_nan'), itertools.product(BOUNDARY_OPTIONS, NANHANDLING_OPTIONS, NORMALIZE_OPTIONS, PRESERVE_NAN_OPTIONS))
def test_unity_3_withnan(self, boundary, nan_treatment, normalize_kernel, preserve_nan):

    x = np.array([1.0, np.nan, 3.0], dtype=u'>f8')
    y = np.array([0.0, 1.0, 0.0], dtype=u'>f8')
    z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, normalize_kernel=normalize_kernel, preserve_nan=preserve_nan)
    if preserve_nan:
        assert np.isnan(z[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], dtype=u'>f8')))
    else:
        assert np.all((z == x))
