Skip to content

Commit ac6b9c2

Browse files
committed
xfail also test_ndim_error
1 parent 8000835 commit ac6b9c2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/testing/fast_array_utils/_array_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class RngKw(TypedDict):
389389

390390

391391
def _rng_kw(rng: np.random.Generator | None) -> RngKw:
392-
return cast("RngKw", dict(rng=rng) if Version(version("scipy")) >= Version("1.15") else dict(random_state=rng))
392+
return RngKw(rng=rng) if Version(version("scipy")) >= Version("1.15") else cast("RngKw", dict(random_state=rng))
393393

394394

395395
def _half_chunk_size(a: tuple[int, ...]) -> tuple[int, ...]:

tests/test_stats.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ def pbmc64k_reduced_raw() -> sps.csr_array[np.float32]:
141141
@pytest.mark.array_type(skip={*ATS_SPARSE_DS, Flags.Matrix})
142142
@pytest.mark.parametrize("func", STAT_FUNCS)
143143
@pytest.mark.parametrize(("ndim", "axis"), [(1, 0), (2, 3), (2, -1)], ids=["1d-ax0", "2d-ax3", "2d-axneg"])
144-
def test_ndim_error(array_type: ArrayType[Array], func: StatFunNoDtype, ndim: Literal[1, 2], axis: Literal[0, 1] | None) -> None:
144+
def test_ndim_error(
145+
request: pytest.FixtureRequest, array_type: ArrayType[Array], func: StatFunNoDtype, ndim: Literal[1, 2], axis: Literal[0, 1] | None
146+
) -> None:
147+
request.applymarker(_xfail_if_old_scipy(array_type, ndim))
145148
check_ndim(array_type, ndim)
146149
# not using the fixture because we don’t need to test multiple dtypes
147150
np_arr = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float32)

0 commit comments

Comments
 (0)