@@ -237,16 +237,18 @@ def test_channel_refresh(self, table_id, instance_id, temp_rows):
237237 with client .get_table (instance_id , table_id ) as table :
238238 rows = table .read_rows ({})
239239 channel_wrapper = client .transport .grpc_channel
240- first_channel = client . transport . grpc_channel ._channel
240+ first_channel = channel_wrapper ._channel
241241 assert len (rows ) == 2
242242 CrossSync ._Sync_Impl .sleep (2 )
243243 rows_after_refresh = table .read_rows ({})
244244 assert len (rows_after_refresh ) == 2
245245 assert client .transport .grpc_channel is channel_wrapper
246- assert client .transport .grpc_channel ._channel is not first_channel
246+ updated_channel = channel_wrapper ._channel
247+ assert updated_channel is not first_channel
247248 assert isinstance (
248249 client .transport ._logged_channel ._interceptor , GapicInterceptor
249250 )
251+ assert updated_channel ._interceptor == client ._metrics_interceptor
250252 finally :
251253 client .close ()
252254
@@ -258,7 +260,7 @@ def test_mutation_set_cell(self, target, temp_rows):
258260 """Ensure cells can be set properly"""
259261 row_key = b"bulk_mutate"
260262 new_value = uuid .uuid4 ().hex .encode ()
261- row_key , mutation = self ._create_row_and_mutation (
263+ ( row_key , mutation ) = self ._create_row_and_mutation (
262264 target , temp_rows , new_value = new_value
263265 )
264266 target .mutate_row (row_key , mutation )
@@ -312,7 +314,7 @@ def test_bulk_mutations_set_cell(self, client, target, temp_rows):
312314 from google .cloud .bigtable .data .mutations import RowMutationEntry
313315
314316 new_value = uuid .uuid4 ().hex .encode ()
315- row_key , mutation = self ._create_row_and_mutation (
317+ ( row_key , mutation ) = self ._create_row_and_mutation (
316318 target , temp_rows , new_value = new_value
317319 )
318320 bulk_mutation = RowMutationEntry (row_key , [mutation ])
@@ -347,11 +349,11 @@ def test_mutations_batcher_context_manager(self, client, target, temp_rows):
347349 """test batcher with context manager. Should flush on exit"""
348350 from google .cloud .bigtable .data .mutations import RowMutationEntry
349351
350- new_value , new_value2 = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
351- row_key , mutation = self ._create_row_and_mutation (
352+ ( new_value , new_value2 ) = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
353+ ( row_key , mutation ) = self ._create_row_and_mutation (
352354 target , temp_rows , new_value = new_value
353355 )
354- row_key2 , mutation2 = self ._create_row_and_mutation (
356+ ( row_key2 , mutation2 ) = self ._create_row_and_mutation (
355357 target , temp_rows , new_value = new_value2
356358 )
357359 bulk_mutation = RowMutationEntry (row_key , [mutation ])
@@ -372,7 +374,7 @@ def test_mutations_batcher_timer_flush(self, client, target, temp_rows):
372374 from google .cloud .bigtable .data .mutations import RowMutationEntry
373375
374376 new_value = uuid .uuid4 ().hex .encode ()
375- row_key , mutation = self ._create_row_and_mutation (
377+ ( row_key , mutation ) = self ._create_row_and_mutation (
376378 target , temp_rows , new_value = new_value
377379 )
378380 bulk_mutation = RowMutationEntry (row_key , [mutation ])
@@ -394,12 +396,12 @@ def test_mutations_batcher_count_flush(self, client, target, temp_rows):
394396 """batch should flush after flush_limit_mutation_count mutations"""
395397 from google .cloud .bigtable .data .mutations import RowMutationEntry
396398
397- new_value , new_value2 = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
398- row_key , mutation = self ._create_row_and_mutation (
399+ ( new_value , new_value2 ) = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
400+ ( row_key , mutation ) = self ._create_row_and_mutation (
399401 target , temp_rows , new_value = new_value
400402 )
401403 bulk_mutation = RowMutationEntry (row_key , [mutation ])
402- row_key2 , mutation2 = self ._create_row_and_mutation (
404+ ( row_key2 , mutation2 ) = self ._create_row_and_mutation (
403405 target , temp_rows , new_value = new_value2
404406 )
405407 bulk_mutation2 = RowMutationEntry (row_key2 , [mutation2 ])
@@ -426,12 +428,12 @@ def test_mutations_batcher_bytes_flush(self, client, target, temp_rows):
426428 """batch should flush after flush_limit_bytes bytes"""
427429 from google .cloud .bigtable .data .mutations import RowMutationEntry
428430
429- new_value , new_value2 = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
430- row_key , mutation = self ._create_row_and_mutation (
431+ ( new_value , new_value2 ) = [uuid .uuid4 ().hex .encode () for _ in range (2 )]
432+ ( row_key , mutation ) = self ._create_row_and_mutation (
431433 target , temp_rows , new_value = new_value
432434 )
433435 bulk_mutation = RowMutationEntry (row_key , [mutation ])
434- row_key2 , mutation2 = self ._create_row_and_mutation (
436+ ( row_key2 , mutation2 ) = self ._create_row_and_mutation (
435437 target , temp_rows , new_value = new_value2
436438 )
437439 bulk_mutation2 = RowMutationEntry (row_key2 , [mutation2 ])
@@ -457,11 +459,11 @@ def test_mutations_batcher_no_flush(self, client, target, temp_rows):
457459
458460 new_value = uuid .uuid4 ().hex .encode ()
459461 start_value = b"unchanged"
460- row_key , mutation = self ._create_row_and_mutation (
462+ ( row_key , mutation ) = self ._create_row_and_mutation (
461463 target , temp_rows , start_value = start_value , new_value = new_value
462464 )
463465 bulk_mutation = RowMutationEntry (row_key , [mutation ])
464- row_key2 , mutation2 = self ._create_row_and_mutation (
466+ ( row_key2 , mutation2 ) = self ._create_row_and_mutation (
465467 target , temp_rows , start_value = start_value , new_value = new_value
466468 )
467469 bulk_mutation2 = RowMutationEntry (row_key2 , [mutation2 ])
0 commit comments