Skip to content

Commit 94222c0

Browse files
Skip big-endian floats in test_serialize_scipy_sparse if using scipy>=1.15.0 (#8977)
1 parent 40b7646 commit 94222c0

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

distributed/protocol/tests/test_scipy.py

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
from packaging.version import Version
45

56
from distributed.protocol import deserialize, serialize
67

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

1112

13+
SCIPY_VERSION = Version(scipy.__version__)
14+
SCIPY_GE_1_15_0 = SCIPY_VERSION.release >= (1, 15, 0)
15+
16+
1217
@pytest.mark.parametrize(
1318
"sparse_type",
1419
[
@@ -23,7 +28,22 @@
2328
)
2429
@pytest.mark.parametrize(
2530
"dtype",
26-
[numpy.dtype("<f4"), numpy.dtype(">f4"), numpy.dtype("<f8"), numpy.dtype(">f8")],
31+
[
32+
numpy.dtype("<f4"),
33+
pytest.param(
34+
numpy.dtype(">f4"),
35+
marks=pytest.mark.skipif(
36+
SCIPY_GE_1_15_0, reason="https://github.com/scipy/scipy/issues/22258"
37+
),
38+
),
39+
numpy.dtype("<f8"),
40+
pytest.param(
41+
numpy.dtype(">f8"),
42+
marks=pytest.mark.skipif(
43+
SCIPY_GE_1_15_0, reason="https://github.com/scipy/scipy/issues/22258"
44+
),
45+
),
46+
],
2747
)
2848
def test_serialize_scipy_sparse(sparse_type, dtype):
2949
a = numpy.array([[0, 1, 0], [2, 0, 3], [0, 4, 0]], dtype=dtype)

0 commit comments

Comments
 (0)