@@ -62,8 +62,8 @@ def test_validate_inputs(self):
6262 with pytest .raises (
6363 ValueError ,
6464 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\\ ."
6767 ),
6868 ):
6969 var3 = op1 (var1 )
@@ -208,7 +208,7 @@ def test_import_var(self):
208208 assert var5 in fg .variables
209209 assert var5 .owner in fg .apply_nodes
210210
211- with pytest .raises (TypeError , match = "Computation graph contains.*" ):
211+ with pytest .raises (TypeError , match = r "Computation graph contains.*" ):
212212 from pytensor .graph .null_type import NullType
213213
214214 fg .import_var (NullType ()(), "testing" )
@@ -265,7 +265,7 @@ def test_replace_test_value(self):
265265
266266 assert var6 .tag .test_value .shape != var4 .tag .test_value .shape
267267
268- with pytest .raises (AssertionError , match = "The replacement.*" ):
268+ with pytest .raises (AssertionError , match = r "The replacement.*" ):
269269 fg .replace (var4 , var6 )
270270
271271 def test_replace (self ):
@@ -342,27 +342,27 @@ def test_check_integrity(self):
342342 var5 = op3 (var4 , var2 , var2 )
343343 fg = FunctionGraph ([var1 , var2 ], [var3 , var5 ], clone = False )
344344
345- with pytest .raises (Exception , match = "The following nodes are .*" ):
345+ with pytest .raises (Exception , match = r "The following nodes are .*" ):
346346 fg .apply_nodes .remove (var5 .owner )
347347
348348 fg .check_integrity ()
349349
350- with pytest .raises (Exception , match = "Inconsistent clients.*" ):
350+ with pytest .raises (Exception , match = r "Inconsistent clients.*" ):
351351 fg .apply_nodes .add (var5 .owner )
352352 fg .remove_client (var2 , (var5 .owner , 1 ))
353353
354354 fg .check_integrity ()
355355
356356 fg .add_client (var2 , (var5 .owner , 1 ))
357357
358- with pytest .raises (Exception , match = "The following variables are.*" ):
358+ with pytest .raises (Exception , match = r "The following variables are.*" ):
359359 fg .variables .remove (var4 )
360360
361361 fg .check_integrity ()
362362
363363 fg .variables .add (var4 )
364364
365- with pytest .raises (Exception , match = "Undeclared input.*" ):
365+ with pytest .raises (Exception , match = r "Undeclared input.*" ):
366366 var6 = MyVariable2 ("var6" )
367367 fg .clients [var6 ] = [(var5 .owner , 3 )]
368368 fg .variables .add (var6 )
@@ -376,26 +376,26 @@ def test_check_integrity(self):
376376 # TODO: What if the index value is greater than 1? It will throw an
377377 # `IndexError`, but that doesn't sound like anything we'd want.
378378 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.*" ):
380380 fg .add_client (var4 , (out_node , 0 ))
381381
382382 fg .check_integrity ()
383383
384384 fg .remove_client (var4 , (out_node , 0 ))
385385
386- with pytest .raises (TypeError , match = "The first entry of.*" ):
386+ with pytest .raises (TypeError , match = r "The first entry of.*" ):
387387 fg .add_client (var4 , (None , 0 ))
388388
389389 var7 = op1 (var4 )
390390
391- with pytest .raises (Exception , match = "Client not in FunctionGraph.*" ):
391+ with pytest .raises (Exception , match = r "Client not in FunctionGraph.*" ):
392392 fg .add_client (var4 , (var7 .owner , 0 ))
393393
394394 fg .check_integrity ()
395395
396396 fg .remove_client (var4 , (var7 .owner , 0 ))
397397
398- with pytest .raises (Exception , match = "Inconsistent clients list.*" ):
398+ with pytest .raises (Exception , match = r "Inconsistent clients list.*" ):
399399 fg .add_client (var4 , (var3 .owner , 0 ))
400400
401401 fg .check_integrity ()
0 commit comments