Skip to content

Commit 9d172b7

Browse files
Test changes to account for code changes
1 parent 40a3143 commit 9d172b7

14 files changed

+23
-23
lines changed

dpctl/tests/elementwise/test_add.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def test_add_dtype_error(
337337

338338
y = dpt.zeros_like(ar1, dtype="int8")
339339
assert_raises_regex(
340-
TypeError, "Output array of type.*is needed", dpt.add, ar1, ar2, y
340+
ValueError, "Output array of type.*is needed", dpt.add, ar1, ar2, y
341341
)
342342

343343

@@ -384,7 +384,7 @@ def test_add_inplace_dtype_matrix(op1_dtype, op2_dtype):
384384
dpt.asnumpy(ar3) == np.full(ar3.shape, 2, dtype=ar3.dtype)
385385
).all()
386386
else:
387-
with pytest.raises(TypeError):
387+
with pytest.raises(ValueError):
388388
ar1 += ar2
389389
dpt.add(ar1, ar2, out=ar1)
390390

@@ -404,7 +404,7 @@ def test_add_inplace_dtype_matrix(op1_dtype, op2_dtype):
404404
dpt.asnumpy(ar4) == np.full(ar4.shape, 2, dtype=ar4.dtype)
405405
).all()
406406
else:
407-
with pytest.raises(TypeError):
407+
with pytest.raises(ValueError):
408408
dpt.add(ar1, ar2, out=ar2)
409409

410410

dpctl/tests/elementwise/test_bitwise_and.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_bitwise_and_inplace_dtype_matrix(op1_dtype, op2_dtype):
123123
ar3 &= ar4
124124
assert dpt.all(ar3 == 1)
125125
else:
126-
with pytest.raises(TypeError):
126+
with pytest.raises(ValueError):
127127
ar1 &= ar2
128128
dpt.bitwise_and(ar1, ar2, out=ar1)
129129

@@ -139,5 +139,5 @@ def test_bitwise_and_inplace_dtype_matrix(op1_dtype, op2_dtype):
139139
dpt.bitwise_and(ar3, ar4, out=ar4)
140140
dpt.all(ar4 == 1)
141141
else:
142-
with pytest.raises(TypeError):
142+
with pytest.raises(ValueError):
143143
dpt.bitwise_and(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_bitwise_left_shift.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_bitwise_left_shift_inplace_dtype_matrix(op1_dtype, op2_dtype):
131131
ar3 <<= ar4
132132
assert dpt.all(ar3 == 2)
133133
else:
134-
with pytest.raises(TypeError):
134+
with pytest.raises(ValueError):
135135
ar1 <<= ar2
136136
dpt.bitwise_left_shift(ar1, ar2, out=ar1)
137137

@@ -147,5 +147,5 @@ def test_bitwise_left_shift_inplace_dtype_matrix(op1_dtype, op2_dtype):
147147
dpt.bitwise_left_shift(ar3, ar4, out=ar4)
148148
dpt.all(ar4 == 2)
149149
else:
150-
with pytest.raises(TypeError):
150+
with pytest.raises(ValueError):
151151
dpt.bitwise_left_shift(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_bitwise_or.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_bitwise_or_inplace_dtype_matrix(op1_dtype, op2_dtype):
123123
ar3 |= ar4
124124
assert dpt.all(ar3 == 1)
125125
else:
126-
with pytest.raises(TypeError):
126+
with pytest.raises(ValueError):
127127
ar1 |= ar2
128128
dpt.bitwise_or(ar1, ar2, out=ar1)
129129

@@ -139,5 +139,5 @@ def test_bitwise_or_inplace_dtype_matrix(op1_dtype, op2_dtype):
139139
dpt.bitwise_or(ar3, ar4, out=ar4)
140140
dpt.all(ar4 == 1)
141141
else:
142-
with pytest.raises(TypeError):
142+
with pytest.raises(ValueError):
143143
dpt.bitwise_or(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_bitwise_right_shift.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_bitwise_right_shift_inplace_dtype_matrix(op1_dtype, op2_dtype):
131131
ar3 >>= ar4
132132
assert dpt.all(ar3 == 0)
133133
else:
134-
with pytest.raises(TypeError):
134+
with pytest.raises(ValueError):
135135
ar1 >>= ar2
136136
dpt.bitwise_right_shift(ar1, ar2, out=ar1)
137137

@@ -147,5 +147,5 @@ def test_bitwise_right_shift_inplace_dtype_matrix(op1_dtype, op2_dtype):
147147
dpt.bitwise_right_shift(ar3, ar4, out=ar4)
148148
dpt.all(ar4 == 0)
149149
else:
150-
with pytest.raises(TypeError):
150+
with pytest.raises(ValueError):
151151
dpt.bitwise_right_shift(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_bitwise_xor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_bitwise_xor_inplace_dtype_matrix(op1_dtype, op2_dtype):
123123
ar3 ^= ar4
124124
assert dpt.all(ar3 == 0)
125125
else:
126-
with pytest.raises(TypeError):
126+
with pytest.raises(ValueError):
127127
ar1 ^= ar2
128128
dpt.bitwise_xor(ar1, ar2, out=ar1)
129129

@@ -139,5 +139,5 @@ def test_bitwise_xor_inplace_dtype_matrix(op1_dtype, op2_dtype):
139139
dpt.bitwise_xor(ar3, ar4, out=ar4)
140140
dpt.all(ar4 == 0)
141141
else:
142-
with pytest.raises(TypeError):
142+
with pytest.raises(ValueError):
143143
dpt.bitwise_xor(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_divide.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_divide_inplace_dtype_matrix(op1_dtype, op2_dtype):
235235
ar3 /= ar4
236236
assert dpt.all(ar3 == 1)
237237
else:
238-
with pytest.raises(TypeError):
238+
with pytest.raises(ValueError):
239239
ar1 /= ar2
240240
dpt.divide(ar1, ar2, out=ar1)
241241

@@ -254,5 +254,5 @@ def test_divide_inplace_dtype_matrix(op1_dtype, op2_dtype):
254254
dpt.divide(ar3, ar4, out=ar4)
255255
dpt.all(ar4 == 1)
256256
else:
257-
with pytest.raises(TypeError):
257+
with pytest.raises(ValueError):
258258
dpt.divide(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_floor_ceil_trunc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_floor_ceil_trunc_error_dtype(dpt_call, dtype):
100100
x = dpt.zeros(5, dtype=dtype)
101101
y = dpt.empty_like(x, dtype="b1")
102102
assert_raises_regex(
103-
TypeError, "Output array of type.*is needed", dpt_call, x, y
103+
ValueError, "Output array of type.*is needed", dpt_call, x, y
104104
)
105105

106106

dpctl/tests/elementwise/test_floor_divide.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def test_floor_divide_inplace_dtype_matrix(op1_dtype, op2_dtype):
299299
ar3 //= ar4
300300
assert dpt.all(ar3 == 1)
301301
else:
302-
with pytest.raises(TypeError):
302+
with pytest.raises(ValueError):
303303
ar1 //= ar2
304304
dpt.floor_divide(ar1, ar2, out=ar1)
305305

@@ -315,5 +315,5 @@ def test_floor_divide_inplace_dtype_matrix(op1_dtype, op2_dtype):
315315
dpt.floor_divide(ar3, ar4, out=ar4)
316316
dpt.all(ar4 == 1)
317317
else:
318-
with pytest.raises(TypeError):
318+
with pytest.raises(ValueError):
319319
dpt.floor_divide(ar1, ar2, out=ar2)

dpctl/tests/elementwise/test_logaddexp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,5 @@ def test_logaddexp_dtype_error(
189189

190190
y = dpt.zeros_like(ar1, dtype="int8")
191191
assert_raises_regex(
192-
TypeError, "Output array of type.*is needed", dpt.logaddexp, ar1, ar2, y
192+
ValueError, "Output array of type.*is needed", dpt.logaddexp, ar1, ar2, y
193193
)

dpctl/tests/elementwise/test_multiply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def test_multiply_inplace_dtype_matrix(op1_dtype, op2_dtype):
220220
).all()
221221

222222
else:
223-
with pytest.raises(TypeError):
223+
with pytest.raises(ValueError):
224224
ar1 *= ar2
225225

226226

dpctl/tests/elementwise/test_pow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_pow_inplace_dtype_matrix(op1_dtype, op2_dtype):
198198
).all()
199199

200200
else:
201-
with pytest.raises(TypeError):
201+
with pytest.raises(ValueError):
202202
ar1 **= ar2
203203

204204

dpctl/tests/elementwise/test_remainder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def test_remainder_inplace_dtype_matrix(op1_dtype, op2_dtype):
246246
assert dpt.all(ar3 == dpt.zeros(ar3.shape, dtype=ar3.dtype))
247247

248248
else:
249-
with pytest.raises(TypeError):
249+
with pytest.raises(ValueError):
250250
ar1 %= ar2
251251

252252

dpctl/tests/elementwise/test_subtract.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_subtract_inplace_dtype_matrix(op1_dtype, op2_dtype):
211211
assert (dpt.asnumpy(ar3) == np.zeros(ar3.shape, dtype=ar3.dtype)).all()
212212

213213
else:
214-
with pytest.raises(TypeError):
214+
with pytest.raises(ValueError):
215215
ar1 -= ar2
216216

217217

0 commit comments

Comments
 (0)