File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1445,7 +1445,8 @@ def test_replace_reject_unknown_instance_fields(self):
14451445
14461446 def test_replace_non_str_kwarg (self ):
14471447 node = ast .Name (id = "x" )
1448- with self .assertRaisesRegex (TypeError , "got an unexpected keyword argument <object object" ):
1448+ errmsg = "got an unexpected keyword argument <object object"
1449+ with self .assertRaisesRegex (TypeError , errmsg ):
14491450 node .__replace__ (** {object (): "y" })
14501451
14511452
@@ -3311,9 +3312,10 @@ class _AllFieldTypes(ast.AST):
33113312 self .assertEqual (obj .b , [])
33123313
33133314 def test_non_str_kwarg (self ):
3315+ warn_msg = "got an unexpected keyword argument <object object"
33143316 with (
33153317 self .assertRaises (TypeError ),
3316- self .assertWarnsRegex (DeprecationWarning , "got an unexpected keyword argument <object object" ),
3318+ self .assertWarnsRegex (DeprecationWarning , warn_msg ),
33173319 ):
33183320 ast .Name (** {object (): 'y' })
33193321
You can’t perform that action at this time.
0 commit comments