@@ -62,8 +62,8 @@ def test_validate_inputs(self):
62
62
with pytest .raises (
63
63
ValueError ,
64
64
match = (
65
- "One of the provided inputs is the output of an already existing node. "
66
- "If that is okay, either discard that input's owner or use graph.clone."
65
+ "One of the provided inputs is the output of an already existing node\\ . "
66
+ "If that is okay, either discard that input's owner or use graph\\ .clone\\ ."
67
67
),
68
68
):
69
69
var3 = op1 (var1 )
@@ -208,7 +208,7 @@ def test_import_var(self):
208
208
assert var5 in fg .variables
209
209
assert var5 .owner in fg .apply_nodes
210
210
211
- with pytest .raises (TypeError , match = "Computation graph contains.*" ):
211
+ with pytest .raises (TypeError , match = r "Computation graph contains.*" ):
212
212
from pytensor .graph .null_type import NullType
213
213
214
214
fg .import_var (NullType ()(), "testing" )
@@ -265,7 +265,7 @@ def test_replace_test_value(self):
265
265
266
266
assert var6 .tag .test_value .shape != var4 .tag .test_value .shape
267
267
268
- with pytest .raises (AssertionError , match = "The replacement.*" ):
268
+ with pytest .raises (AssertionError , match = r "The replacement.*" ):
269
269
fg .replace (var4 , var6 )
270
270
271
271
def test_replace (self ):
@@ -342,27 +342,27 @@ def test_check_integrity(self):
342
342
var5 = op3 (var4 , var2 , var2 )
343
343
fg = FunctionGraph ([var1 , var2 ], [var3 , var5 ], clone = False )
344
344
345
- with pytest .raises (Exception , match = "The following nodes are .*" ):
345
+ with pytest .raises (Exception , match = r "The following nodes are .*" ):
346
346
fg .apply_nodes .remove (var5 .owner )
347
347
348
348
fg .check_integrity ()
349
349
350
- with pytest .raises (Exception , match = "Inconsistent clients.*" ):
350
+ with pytest .raises (Exception , match = r "Inconsistent clients.*" ):
351
351
fg .apply_nodes .add (var5 .owner )
352
352
fg .remove_client (var2 , (var5 .owner , 1 ))
353
353
354
354
fg .check_integrity ()
355
355
356
356
fg .add_client (var2 , (var5 .owner , 1 ))
357
357
358
- with pytest .raises (Exception , match = "The following variables are.*" ):
358
+ with pytest .raises (Exception , match = r "The following variables are.*" ):
359
359
fg .variables .remove (var4 )
360
360
361
361
fg .check_integrity ()
362
362
363
363
fg .variables .add (var4 )
364
364
365
- with pytest .raises (Exception , match = "Undeclared input.*" ):
365
+ with pytest .raises (Exception , match = r "Undeclared input.*" ):
366
366
var6 = MyVariable2 ("var6" )
367
367
fg .clients [var6 ] = [(var5 .owner , 3 )]
368
368
fg .variables .add (var6 )
@@ -376,26 +376,26 @@ def test_check_integrity(self):
376
376
# TODO: What if the index value is greater than 1? It will throw an
377
377
# `IndexError`, but that doesn't sound like anything we'd want.
378
378
out_node = Output (idx = 1 ).make_node (var4 )
379
- with pytest .raises (Exception , match = "Inconsistent clients list.*" ):
379
+ with pytest .raises (Exception , match = r "Inconsistent clients list.*" ):
380
380
fg .add_client (var4 , (out_node , 0 ))
381
381
382
382
fg .check_integrity ()
383
383
384
384
fg .remove_client (var4 , (out_node , 0 ))
385
385
386
- with pytest .raises (TypeError , match = "The first entry of.*" ):
386
+ with pytest .raises (TypeError , match = r "The first entry of.*" ):
387
387
fg .add_client (var4 , (None , 0 ))
388
388
389
389
var7 = op1 (var4 )
390
390
391
- with pytest .raises (Exception , match = "Client not in FunctionGraph.*" ):
391
+ with pytest .raises (Exception , match = r "Client not in FunctionGraph.*" ):
392
392
fg .add_client (var4 , (var7 .owner , 0 ))
393
393
394
394
fg .check_integrity ()
395
395
396
396
fg .remove_client (var4 , (var7 .owner , 0 ))
397
397
398
- with pytest .raises (Exception , match = "Inconsistent clients list.*" ):
398
+ with pytest .raises (Exception , match = r "Inconsistent clients list.*" ):
399
399
fg .add_client (var4 , (var3 .owner , 0 ))
400
400
401
401
fg .check_integrity ()
0 commit comments