2626# mypy: disable-error-code=no-untyped-usage
2727
2828
29- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no expand_dims" )
29+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
3030class TestAtLeastND :
3131 def test_0D (self , xp : ModuleType ):
3232 x = xp .asarray (1.0 )
@@ -98,7 +98,7 @@ def test_xp(self, xp: ModuleType):
9898 xp_assert_equal (y , x )
9999
100100
101- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no isdtype" )
101+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no isdtype" )
102102class TestCov :
103103 def test_basic (self , xp : ModuleType ):
104104 xp_assert_close (
@@ -137,15 +137,17 @@ def test_device(self, xp: ModuleType, device: Device):
137137 x = xp .asarray ([1 , 2 , 3 ], device = device )
138138 assert get_device (cov (x )) == device
139139
140- @pytest .mark .skip_xp_backend (Backend .NUMPY_READONLY )
140+ @pytest .mark .skip_xp_backend (
141+ Backend .NUMPY_READONLY , reason = "numpy_readonly:explicit xp"
142+ )
141143 def test_xp (self , xp : ModuleType ):
142144 xp_assert_close (
143145 cov (xp .asarray ([[0.0 , 2.0 ], [1.0 , 1.0 ], [2.0 , 0.0 ]]).T , xp = xp ),
144146 xp .asarray ([[1.0 , - 1.0 ], [- 1.0 , 1.0 ]], dtype = xp .float64 ),
145147 )
146148
147149
148- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no device" )
150+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no device kwarg in asarray " )
149151class TestCreateDiagonal :
150152 def test_1d (self , xp : ModuleType ):
151153 # from np.diag tests
@@ -191,10 +193,10 @@ def test_xp(self, xp: ModuleType):
191193 xp_assert_equal (y , xp .asarray ([[1 , 0 ], [0 , 2 ]]))
192194
193195
194- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no sparse. expand_dims" )
196+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
195197class TestExpandDims :
196- @pytest .mark .skip_xp_backend (Backend .DASK_ARRAY , reason = "tuple index out of range" )
197- @pytest .mark .skip_xp_backend (Backend .TORCH , reason = "tuple index out of range" )
198+ @pytest .mark .skip_xp_backend (Backend .DASK , reason = "dask: tuple index out of range" )
199+ @pytest .mark .skip_xp_backend (Backend .TORCH , reason = "torch: tuple index out of range" )
198200 def test_functionality (self , xp : ModuleType ):
199201 def _squeeze_all (b : Array ) -> Array :
200202 """Mimics `np.squeeze(b)`. `xpx.squeeze`?"""
@@ -252,7 +254,7 @@ def test_xp(self, xp: ModuleType):
252254 assert y .shape == (1 , 1 , 1 , 3 )
253255
254256
255- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no sparse. expand_dims" )
257+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no expand_dims" )
256258class TestKron :
257259 def test_basic (self , xp : ModuleType ):
258260 # Using 0-dimensional array
@@ -349,7 +351,9 @@ def test_xp(self, xp: ModuleType):
349351 xp_assert_equal (nunique (a , xp = xp ), xp .asarray (3 ))
350352
351353
352- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no arange, no device" )
354+ @pytest .mark .skip_xp_backend (
355+ Backend .SPARSE , reason = "sparse:no arange, no device kwarg in asarray"
356+ )
353357class TestPad :
354358 def test_simple (self , xp : ModuleType ):
355359 a = xp .arange (1 , 4 )
@@ -399,8 +403,8 @@ def test_list_of_tuples_width(self, xp: ModuleType):
399403 assert padded .shape == (4 , 4 )
400404
401405
402- @pytest .mark .skip_xp_backend (Backend .DASK_ARRAY , reason = "no argsort" )
403- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no device" )
406+ @pytest .mark .skip_xp_backend (Backend .DASK , reason = "dask: no argsort" )
407+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no device kwarg in asarray " )
404408class TestSetDiff1D :
405409 @pytest .mark .skip_xp_backend (
406410 Backend .TORCH , reason = "index_select not implemented for uint32"
@@ -436,7 +440,9 @@ def test_device(self, xp: ModuleType, device: Device):
436440 x2 = xp .asarray ([2 , 3 , 4 ], device = device )
437441 assert get_device (setdiff1d (x1 , x2 )) == device
438442
439- @pytest .mark .skip_xp_backend (Backend .NUMPY_READONLY )
443+ @pytest .mark .skip_xp_backend (
444+ Backend .NUMPY_READONLY , reason = "numpy_readonly:explicit xp"
445+ )
440446 def test_xp (self , xp : ModuleType ):
441447 x1 = xp .asarray ([3 , 8 , 20 ])
442448 x2 = xp .asarray ([2 , 3 , 4 ])
@@ -445,7 +451,7 @@ def test_xp(self, xp: ModuleType):
445451 xp_assert_equal (actual , expected )
446452
447453
448- @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "no isdtype" )
454+ @pytest .mark .skip_xp_backend (Backend .SPARSE , reason = "sparse: no isdtype" )
449455class TestSinc :
450456 def test_simple (self , xp : ModuleType ):
451457 xp_assert_equal (sinc (xp .asarray (0.0 )), xp .asarray (1.0 ))
0 commit comments