Skip to content

Commit 44cbd16

Browse files
committed
Self-review
1 parent 211a84c commit 44cbd16

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ def xp(
131131
return xp
132132

133133

134-
@pytest.fixture(params=[Backend.DASK]) # Select the test with `pytest -k dask`
134+
@pytest.fixture(params=[Backend.DASK]) # Can select the test with `pytest -k dask`
135135
def da(
136136
request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch
137137
) -> ModuleType: # numpydoc ignore=PR01,RT01
138-
"""Fixture that returns dask.array (wrapped by array-api-compat)."""
138+
"""Variant of the `xp` fixture that only yields dask.array."""
139139
xp = pytest.importorskip("dask.array")
140140
xp = array_namespace(xp.empty(0))
141141
patch_lazy_xp_functions(request, monkeypatch, xp=xp)

tests/test_lazy.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ def f(x: Array) -> tuple[Array, Array]:
9595
[
9696
pytest.param(
9797
False,
98-
marks=[
99-
pytest.mark.xfail_xp_backend(
100-
Backend.TORCH, reason="illegal dtype promotion"
101-
),
102-
],
98+
marks=pytest.mark.xfail_xp_backend(
99+
Backend.TORCH, reason="illegal dtype promotion"
100+
),
103101
),
104102
pytest.param(
105103
True,
@@ -218,7 +216,8 @@ def f(x: Array) -> Array:
218216
return x
219217

220218
x = x[x > 1]
221-
return lazy_apply(f, x)
219+
# Use explicit namespace to bypass monkey-patching by lazy_xp_function
220+
return xpx.lazy_apply(f, x)
222221

223222

224223
lazy_xp_function(check_lazy_apply_none_shape_broadcast)

0 commit comments

Comments
 (0)