@@ -208,8 +208,10 @@ def test__start_background_channel_refresh(self):
208208 def test__ping_and_warm_instances (self ):
209209 """test ping and warm with mocked asyncio.gather"""
210210 client_mock = mock .Mock ()
211- client_mock ._execute_ping_and_warms = lambda * args : (
212- self ._get_target_class ()._execute_ping_and_warms (client_mock , * args )
211+ client_mock ._execute_ping_and_warms = (
212+ lambda * args : self ._get_target_class ()._execute_ping_and_warms (
213+ client_mock , * args
214+ )
213215 )
214216 with mock .patch .object (
215217 CrossSync ._Sync_Impl , "gather_partials" , CrossSync ._Sync_Impl .Mock ()
@@ -252,8 +254,10 @@ def test__ping_and_warm_instances(self):
252254 def test__ping_and_warm_single_instance (self ):
253255 """should be able to call ping and warm with single instance"""
254256 client_mock = mock .Mock ()
255- client_mock ._execute_ping_and_warms = lambda * args : (
256- self ._get_target_class ()._execute_ping_and_warms (client_mock , * args )
257+ client_mock ._execute_ping_and_warms = (
258+ lambda * args : self ._get_target_class ()._execute_ping_and_warms (
259+ client_mock , * args
260+ )
257261 )
258262 with mock .patch .object (
259263 CrossSync ._Sync_Impl , "gather_partials" , CrossSync ._Sync_Impl .Mock ()
@@ -1322,11 +1326,11 @@ def _make_client(self, *args, **kwargs):
13221326
13231327 def _make_table (self , * args , ** kwargs ):
13241328 client_mock = mock .Mock ()
1325- client_mock ._register_instance .side_effect = lambda * args , ** kwargs : (
1326- CrossSync ._Sync_Impl .yield_to_event_loop ()
1329+ client_mock ._register_instance .side_effect = (
1330+ lambda * args , ** kwargs : CrossSync ._Sync_Impl .yield_to_event_loop ()
13271331 )
1328- client_mock ._remove_instance_registration .side_effect = lambda * args , ** kwargs : (
1329- CrossSync ._Sync_Impl .yield_to_event_loop ()
1332+ client_mock ._remove_instance_registration .side_effect = (
1333+ lambda * args , ** kwargs : CrossSync ._Sync_Impl .yield_to_event_loop ()
13301334 )
13311335 kwargs ["instance_id" ] = kwargs .get (
13321336 "instance_id" , args [0 ] if args else "instance"
@@ -1788,8 +1792,9 @@ def test_read_rows_sharded_multiple_queries(self):
17881792 with mock .patch .object (
17891793 table .client ._gapic_client , "read_rows"
17901794 ) as read_rows :
1791- read_rows .side_effect = lambda * args , ** kwargs : (
1792- CrossSync ._Sync_Impl .TestReadRows ._make_gapic_stream (
1795+ read_rows .side_effect = (
1796+ lambda * args ,
1797+ ** kwargs : CrossSync ._Sync_Impl .TestReadRows ._make_gapic_stream (
17931798 [
17941799 CrossSync ._Sync_Impl .TestReadRows ._make_chunk (row_key = k )
17951800 for k in args [0 ].rows .row_keys
@@ -2900,7 +2905,6 @@ def prepare_mock(self, client):
29002905 yield prepare_mock
29012906
29022907 def _make_gapic_stream (self , sample_list : list ["ExecuteQueryResponse" | Exception ]):
2903-
29042908 class MockStream :
29052909 def __init__ (self , sample_list ):
29062910 self .sample_list = sample_list
0 commit comments