@@ -38,12 +38,7 @@ def test_device(self, xp: ModuleType, device: Device):
3838
3939
4040class TestAssertEqualCloseLess :
41- pr_assert_close = pytest .param ( # pyright: ignore[reportUnannotatedClassAttribute]
42- xp_assert_close ,
43- marks = pytest .mark .xfail_xp_backend (Backend .SPARSE , reason = "no isdtype" ),
44- )
45-
46- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close ])
41+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close ])
4742 def test_assert_equal_close_basic (self , xp : ModuleType , func : Callable [..., None ]):
4843 func (xp .asarray (0 ), xp .asarray (0 ))
4944 func (xp .asarray ([1 , 2 ]), xp .asarray ([1 , 2 ]))
@@ -75,7 +70,7 @@ def test_namespace(self, xp: ModuleType, func: Callable[..., None]):
7570 with pytest .raises (TypeError , match = "list is not a supported array type" ):
7671 func (xp .asarray ([0 ]), [0 ])
7772
78- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close , xp_assert_less ])
73+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close , xp_assert_less ])
7974 def test_check_shape (self , xp : ModuleType , func : Callable [..., None ]):
8075 a = xp .asarray ([1 ] if func is xp_assert_less else [2 ])
8176 b = xp .asarray (2 )
@@ -90,7 +85,7 @@ def test_check_shape(self, xp: ModuleType, func: Callable[..., None]):
9085 with pytest .raises (AssertionError , match = "sizes do not match" ):
9186 func (a , d , check_shape = False )
9287
93- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close , xp_assert_less ])
88+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close , xp_assert_less ])
9489 def test_check_dtype (self , xp : ModuleType , func : Callable [..., None ]):
9590 a = xp .asarray (1 if func is xp_assert_less else 2 )
9691 b = xp .asarray (2 , dtype = xp .int16 )
@@ -102,7 +97,7 @@ def test_check_dtype(self, xp: ModuleType, func: Callable[..., None]):
10297 with pytest .raises (AssertionError , match = "Mismatched elements" ):
10398 func (a , c , check_dtype = False )
10499
105- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close , xp_assert_less ])
100+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close , xp_assert_less ])
106101 @pytest .mark .xfail_xp_backend (
107102 Backend .SPARSE , reason = "sparse [()] returns np.generic"
108103 )
@@ -122,7 +117,6 @@ def test_check_scalar(
122117 with pytest .raises (AssertionError , match = "Mismatched elements" ):
123118 func (a , c , check_scalar = True )
124119
125- @pytest .mark .xfail_xp_backend (Backend .SPARSE , reason = "no isdtype" )
126120 @pytest .mark .parametrize ("dtype" , ["int64" , "float64" ])
127121 def test_assert_close_tolerance (self , dtype : str , xp : ModuleType ):
128122 a = xp .asarray ([100 ], dtype = getattr (xp , dtype ))
@@ -145,7 +139,7 @@ def test_assert_less(self, xp: ModuleType):
145139 with pytest .raises (AssertionError , match = "Mismatched elements" ):
146140 xp_assert_less (xp .asarray ([1 , 1 ]), xp .asarray ([2 , 1 ]))
147141
148- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close , xp_assert_less ])
142+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close , xp_assert_less ])
149143 @pytest .mark .xfail_xp_backend (Backend .SPARSE , reason = "index by sparse array" )
150144 @pytest .mark .skip_xp_backend (Backend .ARRAY_API_STRICTEST , reason = "boolean indexing" )
151145 def test_none_shape (self , xp : ModuleType , func : Callable [..., None ]):
@@ -176,7 +170,7 @@ def test_none_shape(self, xp: ModuleType, func: Callable[..., None]):
176170 with pytest .raises (AssertionError , match = "Mismatched elements" ):
177171 func (xp .asarray ([4 ]), a )
178172
179- @pytest .mark .parametrize ("func" , [xp_assert_equal , pr_assert_close , xp_assert_less ])
173+ @pytest .mark .parametrize ("func" , [xp_assert_equal , xp_assert_close , xp_assert_less ])
180174 def test_device (self , xp : ModuleType , device : Device , func : Callable [..., None ]):
181175 a = xp .asarray ([1 ] if func is xp_assert_less else [2 ], device = device )
182176 b = xp .asarray ([2 ], device = device )
0 commit comments