@@ -201,9 +201,13 @@ def test_plugin_error_handling_get_hooks(self):
201201
202202 # Verify that the error was logged with the correct message
203203 mock_log_error .assert_called_once ()
204- error_call_args = mock_log_error .call_args [0 ]
205- self .assertIn ("Error getting hooks from plugin Error Plugin" , error_call_args [0 ])
206- self .assertIn ("Get hooks error in Error Plugin" , str (error_call_args ))
204+ # Check the format string and arguments separately
205+ format_string = mock_log_error .call_args [0 ][0 ]
206+ format_args = mock_log_error .call_args [0 ][1 :]
207+ self .assertEqual (format_string , "Error getting hooks from plugin %s: %s" )
208+ self .assertEqual (len (format_args ), 2 )
209+ self .assertEqual (format_args [0 ], "Error Plugin" )
210+ self .assertIn ("Get hooks error in Error Plugin" , str (format_args [1 ]))
207211
208212 def test_plugin_error_handling_register (self ):
209213 """Test that errors during plugin registration are handled gracefully."""
@@ -237,9 +241,13 @@ def test_plugin_error_handling_register(self):
237241
238242 # Verify that the error was logged with the correct message
239243 mock_log_error .assert_called_once ()
240- error_call_args = mock_log_error .call_args [0 ]
241- self .assertIn ("Error registering plugin Error Plugin" , error_call_args [0 ])
242- self .assertIn ("Registration error in Error Plugin" , str (error_call_args ))
244+ # Check the format string and arguments separately
245+ format_string = mock_log_error .call_args [0 ][0 ]
246+ format_args = mock_log_error .call_args [0 ][1 :]
247+ self .assertEqual (format_string , "Error registering plugin %s: %s" )
248+ self .assertEqual (len (format_args ), 2 )
249+ self .assertEqual (format_args [0 ], "Error Plugin" )
250+ self .assertIn ("Registration error in Error Plugin" , str (format_args [1 ]))
243251
244252 def test_plugin_with_existing_hooks (self ):
245253 """Test that plugin hooks work alongside existing hooks and config hooks are called before plugin hooks."""
0 commit comments