@@ -931,12 +931,14 @@ def test_handle_reconnect_max_delay(self, random, wait_for):
931
931
)
932
932
@mock .patch ('socketio.client.random.random' , side_effect = [1 , 0 , 0.5 ])
933
933
def test_handle_reconnect_max_attempts (self , random , wait_for ):
934
- c = asyncio_client .AsyncClient (reconnection_attempts = 2 )
934
+ c = asyncio_client .AsyncClient (reconnection_attempts = 2 , logger = True )
935
935
c ._reconnect_task = 'foo'
936
936
c .connect = AsyncMock (
937
937
side_effect = [ValueError , exceptions .ConnectionError , None ]
938
938
)
939
+ c .logger .setLevel ('INFO' )
939
940
_run (c ._handle_reconnect ())
941
+ c .logger .setLevel ('ERROR' )
940
942
print (c .reconnection_attempts )
941
943
print (wait_for .mock .call_count ) # logging to debug #572
942
944
print (wait_for .mock .call_args_list )
@@ -954,12 +956,14 @@ def test_handle_reconnect_max_attempts(self, random, wait_for):
954
956
)
955
957
@mock .patch ('socketio.client.random.random' , side_effect = [1 , 0 , 0.5 ])
956
958
def test_handle_reconnect_aborted (self , random , wait_for ):
957
- c = asyncio_client .AsyncClient ()
959
+ c = asyncio_client .AsyncClient (logger = True )
960
+ c .logger .setLevel ('INFO' )
958
961
c ._reconnect_task = 'foo'
959
962
c .connect = AsyncMock (
960
963
side_effect = [ValueError , exceptions .ConnectionError , None ]
961
964
)
962
965
_run (c ._handle_reconnect ())
966
+ c .logger .setLevel ('ERROR' )
963
967
print (wait_for .mock .call_count ) # logging to debug #572
964
968
print (wait_for .mock .call_args_list )
965
969
assert wait_for .mock .call_count == 2
0 commit comments