File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff 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`
135135def 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 )
Original file line number Diff line number Diff 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
224223lazy_xp_function (check_lazy_apply_none_shape_broadcast )
You can’t perform that action at this time.
0 commit comments