@@ -71,6 +71,18 @@ def test_sync_update_profile_params_bool_warns_and_serializes():
7171 assert payload == {"type" : "profile" , "params" : {"persistChanges" : True }}
7272
7373
74+ def test_sync_update_profile_params_bool_deprecation_warning_only_emitted_once ():
75+ SyncSessionManager ._has_warned_update_profile_params_boolean_deprecated = False
76+ client = _SyncClient ()
77+ manager = SyncSessionManager (client )
78+
79+ with pytest .warns (DeprecationWarning ) as warning_records :
80+ manager .update_profile_params ("session-1" , True )
81+ manager .update_profile_params ("session-2" , True )
82+
83+ assert len (warning_records ) == 1
84+
85+
7486def test_sync_update_profile_params_rejects_conflicting_arguments ():
7587 manager = SyncSessionManager (_SyncClient ())
7688
@@ -97,6 +109,20 @@ async def run() -> None:
97109 assert payload == {"type" : "profile" , "params" : {"persistChanges" : True }}
98110
99111
112+ def test_async_update_profile_params_bool_deprecation_warning_only_emitted_once ():
113+ AsyncSessionManager ._has_warned_update_profile_params_boolean_deprecated = False
114+ client = _AsyncClient ()
115+ manager = AsyncSessionManager (client )
116+
117+ async def run () -> None :
118+ with pytest .warns (DeprecationWarning ) as warning_records :
119+ await manager .update_profile_params ("session-1" , True )
120+ await manager .update_profile_params ("session-2" , True )
121+ assert len (warning_records ) == 1
122+
123+ asyncio .run (run ())
124+
125+
100126def test_async_update_profile_params_rejects_conflicting_arguments ():
101127 manager = AsyncSessionManager (_AsyncClient ())
102128
0 commit comments