Skip to content

Commit 74789e2

Browse files
committed
TST: remove sparse isdtype xfails
1 parent 7cea477 commit 74789e2

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

tests/test_funcs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ def test_none(self, args: tuple[tuple[float | None, ...], ...]):
404404
assert actual == expect
405405

406406

407-
@pytest.mark.xfail_xp_backend(Backend.SPARSE, reason="no isdtype")
408407
class TestCov:
409408
def test_basic(self, xp: ModuleType):
410409
xp_assert_close(
@@ -697,7 +696,6 @@ def test_xp(self, xp: ModuleType):
697696
@pytest.mark.filterwarnings( # array_api_strictest
698697
"ignore:invalid value encountered:RuntimeWarning:array_api_strict"
699698
)
700-
@pytest.mark.xfail_xp_backend(Backend.SPARSE, reason="no isdtype")
701699
class TestIsClose:
702700
@pytest.mark.parametrize("swap", [False, True])
703701
@pytest.mark.parametrize(
@@ -919,7 +917,6 @@ def test_kron_shape(
919917
k = kron(a, b)
920918
assert k.shape == expected_shape
921919

922-
@pytest.mark.xfail_xp_backend(Backend.SPARSE, reason="no isdtype")
923920
def test_python_scalar(self, xp: ModuleType):
924921
a = 1
925922
# Test no dtype promotion to xp.asarray(a); use b.dtype
@@ -1138,7 +1135,6 @@ def test_xp(self, xp: ModuleType):
11381135
xp_assert_equal(actual, expected)
11391136

11401137

1141-
@pytest.mark.xfail_xp_backend(Backend.SPARSE, reason="no isdtype")
11421138
class TestSinc:
11431139
def test_simple(self, xp: ModuleType):
11441140
xp_assert_equal(sinc(xp.asarray(0.0)), xp.asarray(1.0))

tests/test_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def test_xp(self, xp: ModuleType):
7979

8080

8181
class TestAsArrays:
82-
@pytest.mark.xfail_xp_backend(Backend.SPARSE, reason="no isdtype")
8382
@pytest.mark.parametrize(
8483
("dtype", "b", "defined"),
8584
[

tests/test_testing.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ def test_device(self, xp: ModuleType, device: Device):
3838

3939

4040
class 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

Comments
 (0)