@@ -60,11 +60,7 @@ def test_solve(self):
60
60
# for other cases this signature must be followed
61
61
# (..., m, m), (..., m, n) -> (..., m, n)
62
62
# https://github.com/numpy/numpy/pull/25914
63
- if numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0" :
64
- self .check_x ((2 , 4 , 4 ), (2 , 4 ))
65
- self .check_x ((2 , 3 , 2 , 2 ), (2 , 3 , 2 ))
66
- self .check_x ((0 , 2 , 2 ), (0 , 2 ))
67
- else : # Allowed since numpy 2.0
63
+ if numpy .lib .NumpyVersion (numpy .__version__ ) >= "2.0.0" :
68
64
self .check_x ((2 , 3 , 3 ), (3 ,))
69
65
self .check_x ((2 , 5 , 3 , 3 ), (3 ,))
70
66
@@ -101,11 +97,8 @@ def test_invalid_shape(self):
101
97
self .check_shape ((3 , 3 , 4 ), (3 ,), linalg_errors )
102
98
self .check_shape ((3 , 3 ), (0 ,), value_errors )
103
99
self .check_shape ((0 , 3 , 4 ), (3 ,), linalg_errors )
104
- # Since numpy >= 2.0, this case does not raise an error
105
- if numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0" :
106
- self .check_shape ((2 , 3 , 3 ), (3 ,), value_errors )
107
- else :
108
- # Not allowed since numpy 2
100
+ # Not allowed since numpy 2.0
101
+ if numpy .lib .NumpyVersion (numpy .__version__ ) >= "2.0.0" :
109
102
self .check_shape ((0 , 2 , 2 ), (0 , 2 ), value_errors )
110
103
self .check_shape ((2 , 4 , 4 ), (2 , 4 ), value_errors )
111
104
self .check_shape ((2 , 3 , 2 , 2 ), (2 , 3 , 2 ), value_errors )
0 commit comments