@@ -247,8 +247,7 @@ def test_diff_wrong_append_prepend_shape():
247
247
248
248
assert_raises_regex (
249
249
ValueError ,
250
- "`diff` argument `prepend` with shape.*is invalid"
251
- " for first input with shape.*" ,
250
+ ".*shape.*is invalid.*" ,
252
251
dpt .diff ,
253
252
arr ,
254
253
prepend = arr_bad_sh ,
@@ -257,8 +256,7 @@ def test_diff_wrong_append_prepend_shape():
257
256
258
257
assert_raises_regex (
259
258
ValueError ,
260
- "`diff` argument `append` with shape.*is invalid"
261
- " for first input with shape.*" ,
259
+ ".*shape.*is invalid.*" ,
262
260
dpt .diff ,
263
261
arr ,
264
262
prepend = arr ,
@@ -267,17 +265,15 @@ def test_diff_wrong_append_prepend_shape():
267
265
268
266
assert_raises_regex (
269
267
ValueError ,
270
- "`diff` argument `prepend` with shape.*is invalid"
271
- " for first input with shape.*" ,
268
+ ".*shape.*is invalid.*" ,
272
269
dpt .diff ,
273
270
arr ,
274
271
prepend = arr_bad_sh ,
275
272
)
276
273
277
274
assert_raises_regex (
278
275
ValueError ,
279
- "`diff` argument `append` with shape.*is invalid"
280
- " for first input with shape.*" ,
276
+ ".*shape.*is invalid.*" ,
281
277
dpt .diff ,
282
278
arr ,
283
279
append = arr_bad_sh ,
@@ -293,53 +289,20 @@ def test_diff_compute_follows_data():
293
289
ar2 = dpt .ones (1 , dtype = "i4" , sycl_queue = q2 )
294
290
ar3 = dpt .ones (1 , dtype = "i4" , sycl_queue = q3 )
295
291
296
- assert_raises_regex (
297
- ExecutionPlacementError ,
298
- "Execution placement can not be unambiguously inferred from input "
299
- "arguments" ,
300
- dpt .diff ,
301
- ar1 ,
302
- prepend = ar2 ,
303
- append = ar3 ,
304
- )
292
+ with pytest .raises (ExecutionPlacementError ):
293
+ dpt .diff (ar1 , prepend = ar2 , append = ar3 )
305
294
306
- assert_raises_regex (
307
- ExecutionPlacementError ,
308
- "Execution placement can not be unambiguously inferred from input "
309
- "arguments" ,
310
- dpt .diff ,
311
- ar1 ,
312
- prepend = ar2 ,
313
- append = 0 ,
314
- )
295
+ with pytest .raises (ExecutionPlacementError ):
296
+ dpt .diff (ar1 , prepend = ar2 , append = 0 )
315
297
316
- assert_raises_regex (
317
- ExecutionPlacementError ,
318
- "Execution placement can not be unambiguously inferred from input "
319
- "arguments" ,
320
- dpt .diff ,
321
- ar1 ,
322
- prepend = 0 ,
323
- append = ar2 ,
324
- )
298
+ with pytest .raises (ExecutionPlacementError ):
299
+ dpt .diff (ar1 , prepend = 0 , append = ar2 )
325
300
326
- assert_raises_regex (
327
- ExecutionPlacementError ,
328
- "Execution placement can not be unambiguously inferred from input "
329
- "arguments" ,
330
- dpt .diff ,
331
- ar1 ,
332
- prepend = ar2 ,
333
- )
301
+ with pytest .raises (ExecutionPlacementError ):
302
+ dpt .diff (ar1 , prepend = ar2 )
334
303
335
- assert_raises_regex (
336
- ExecutionPlacementError ,
337
- "Execution placement can not be unambiguously inferred from input "
338
- "arguments" ,
339
- dpt .diff ,
340
- ar1 ,
341
- append = ar2 ,
342
- )
304
+ with pytest .raises (ExecutionPlacementError ):
305
+ dpt .diff (ar1 , append = ar2 )
343
306
344
307
345
308
def test_diff_input_validation ():
0 commit comments