HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/astropy/convolution/tests/test_pickle.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst

import numpy as np
import pytest

from astropy import convolution as conv
from astropy.tests.helper import check_pickling_recovery, pickle_protocol  # noqa: F401


@pytest.mark.parametrize(
    ("name", "args", "kwargs", "xfail"),
    [
        (conv.CustomKernel, [], {"array": np.random.rand(15)}, False),
        (conv.Gaussian1DKernel, [1.0], {"x_size": 5}, True),
        (conv.Gaussian2DKernel, [1.0], {"x_size": 5, "y_size": 5}, True),
    ],
)
def test_simple_object(pickle_protocol, name, args, kwargs, xfail):  # noqa: F811
    # Tests easily instantiated objects
    if xfail:
        pytest.xfail()
    original = name(*args, **kwargs)
    check_pickling_recovery(original, pickle_protocol)