@@ -220,12 +220,13 @@ async def test_send_notification_http_status_error(
220220 await self .notifier .send_notification (task_data ) # Pass only task_data
221221
222222 self .mock_httpx_client .post .assert_awaited_once ()
223- mock_logger .error .assert_called_once ()
223+ mock_logger .exception .assert_called_once ()
224224 # Check that the error message contains the generic part and the specific exception string
225225 self .assertIn (
226- 'Error sending push-notification' , mock_logger .error .call_args [0 ][0 ]
226+ 'Error sending push-notification' ,
227+ mock_logger .exception .call_args [0 ][0 ],
227228 )
228- self .assertIn (str (http_error ), mock_logger .error .call_args [0 ][0 ])
229+ self .assertIn (str (http_error ), mock_logger .exception .call_args [0 ][0 ])
229230
230231 @patch ('a2a.server.tasks.base_push_notification_sender.logger' )
231232 async def test_send_notification_request_error (
@@ -242,11 +243,12 @@ async def test_send_notification_request_error(
242243 await self .notifier .send_notification (task_data ) # Pass only task_data
243244
244245 self .mock_httpx_client .post .assert_awaited_once ()
245- mock_logger .error .assert_called_once ()
246+ mock_logger .exception .assert_called_once ()
246247 self .assertIn (
247- 'Error sending push-notification' , mock_logger .error .call_args [0 ][0 ]
248+ 'Error sending push-notification' ,
249+ mock_logger .exception .call_args [0 ][0 ],
248250 )
249- self .assertIn (str (request_error ), mock_logger .error .call_args [0 ][0 ])
251+ self .assertIn (str (request_error ), mock_logger .exception .call_args [0 ][0 ])
250252
251253 @patch ('a2a.server.tasks.base_push_notification_sender.logger' )
252254 async def test_send_notification_with_auth (self , mock_logger : MagicMock ):
0 commit comments