Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion distributed/protocol/tests/test_scipy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import pytest
from packaging.version import Version

from distributed.protocol import deserialize, serialize

Expand All @@ -9,6 +10,10 @@
scipy_sparse = pytest.importorskip("scipy.sparse")


SCIPY_VERSION = Version(scipy.__version__)
SCIPY_GE_1_15_0 = SCIPY_VERSION.release >= (1, 15, 0)


@pytest.mark.parametrize(
"sparse_type",
[
Expand All @@ -23,7 +28,22 @@
)
@pytest.mark.parametrize(
"dtype",
[numpy.dtype("<f4"), numpy.dtype(">f4"), numpy.dtype("<f8"), numpy.dtype(">f8")],
[
numpy.dtype("<f4"),
pytest.param(
numpy.dtype(">f4"),
marks=pytest.mark.skipif(
SCIPY_GE_1_15_0, reason="https://github.com/scipy/scipy/issues/22258"
),
),
numpy.dtype("<f8"),
pytest.param(
numpy.dtype(">f8"),
marks=pytest.mark.skipif(
SCIPY_GE_1_15_0, reason="https://github.com/scipy/scipy/issues/22258"
),
),
],
)
def test_serialize_scipy_sparse(sparse_type, dtype):
a = numpy.array([[0, 1, 0], [2, 0, 3], [0, 4, 0]], dtype=dtype)
Expand Down
Loading