Skip to content

Commit 3001872

Browse files
Skip test_solve_singular_empty
1 parent e76b278 commit 3001872

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

tests/third_party/cupy/linalg_tests/test_solve.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,14 @@ def check_shape(self, a_shape, b_shape, error_types):
6161
with pytest.raises(error_type):
6262
xp.linalg.solve(a, b)
6363

64-
def test_solve_singular_empty(self):
65-
for xp in (numpy, cupy):
66-
a = xp.zeros((3, 3)) # singular
67-
b = xp.empty((3, 0)) # nrhs = 0
68-
# Different behavior of numpy and dpnp in this case
69-
# numpy raises LinAlgError when b.size == 0 and a is a singular matrix
70-
# dpnp returns an empty array
71-
if xp == numpy:
72-
with pytest.raises(numpy.linalg.LinAlgError):
73-
xp.linalg.solve(a, b)
74-
else:
75-
result = xp.linalg.solve(a, b)
76-
assert result.size == 0
64+
# Undefined behavior is implementation-dependent:
65+
# Numpy with OpenBLAS returns an empty array while numpy with MKL raises LinAlgError
66+
@pytest.mark.skip("Undefined behavior")
67+
def test_solve_singular_empty(self, xp):
68+
a = xp.zeros((3, 3)) # singular
69+
b = xp.empty((3, 0)) # nrhs = 0
70+
# LinAlgError("Singular matrix") is not raised
71+
return xp.linalg.solve(a, b)
7772

7873
def test_invalid_shape(self):
7974
linalg_errors = {

0 commit comments

Comments
 (0)