1616import inspect
1717from typing import AsyncGenerator , Callable , Mapping
1818from unittest .mock import AsyncMock , Mock
19+ from warnings import catch_warnings , simplefilter
1920
2021import pytest
2122import pytest_asyncio
2223from aiohttp import ClientSession
2324from aioresponses import aioresponses
2425from pydantic import ValidationError
25- from warnings import catch_warnings , simplefilter
2626
2727from toolbox_core .protocol import ParameterSchema
2828from toolbox_core .tool import ToolboxTool , create_func_docstring , resolve_value
@@ -357,7 +357,9 @@ def test_tool_init_basic(http_session, sample_tool_params, sample_tool_descripti
357357 bound_params = {},
358358 client_headers = {},
359359 )
360- assert len (record ) == 0 , f"ToolboxTool instantiation unexpectedly warned: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
360+ assert (
361+ len (record ) == 0
362+ ), f"ToolboxTool instantiation unexpectedly warned: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
361363
362364 assert tool_instance .__name__ == TEST_TOOL_NAME
363365 assert inspect .iscoroutinefunction (tool_instance .__call__ )
@@ -572,7 +574,10 @@ def test_tool_init_no_http_warning_if_https(
572574 bound_params = {},
573575 client_headers = static_client_header ,
574576 )
575- assert len (record ) == 0 , f"Expected no warnings, but got: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
577+ assert (
578+ len (record ) == 0
579+ ), f"Expected no warnings, but got: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
580+
576581
577582def test_tool_init_no_http_warning_if_no_sensitive_info_on_http (
578583 http_session : ClientSession ,
@@ -598,4 +603,6 @@ def test_tool_init_no_http_warning_if_no_sensitive_info_on_http(
598603 bound_params = {},
599604 client_headers = {},
600605 )
601- assert len (record ) == 0 , f"Expected no warnings, but got: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
606+ assert (
607+ len (record ) == 0
608+ ), f"Expected no warnings, but got: { [f'{ w .category .__name__ } : { w .message } ' for w in record ]} "
0 commit comments