Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit c6fd3ad

Browse files
committed
linting
1 parent 1f32073 commit c6fd3ad

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

tests/unit/admin_overlay/test_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# try/except added for compatibility with python < 3.8
1717
try:
1818
from unittest import mock
19-
from unittest.mock import AsyncMock # pragma: NO COVER
2019
except ImportError: # pragma: NO COVER
2120
import mock
2221

@@ -150,11 +149,11 @@ def test_bigtable_table_admin_client_wait_for_consistency(kwargs):
150149

151150
future = client.wait_for_consistency(**kwargs)
152151

153-
assert type(future) == consistency.CheckConsistencyPollingFuture
152+
assert isinstance(future, consistency.CheckConsistencyPollingFuture)
154153
assert future._default_retry == kwargs.get("retry", gapic_v1.method.DEFAULT)
155154

156155
check_consistency_call = future._check_consistency_call
157-
assert type(check_consistency_call) == functools.partial
156+
assert isinstance(check_consistency_call, functools.partial)
158157

159158
assert check_consistency_call.func == client.check_consistency
160159
assert check_consistency_call.args == (kwargs.get("request", None),)
@@ -208,11 +207,11 @@ def test_bigtable_table_admin_client_wait_for_replication(kwargs):
208207
)
209208
)
210209

211-
assert type(future) == consistency.CheckConsistencyPollingFuture
210+
assert isinstance(future, consistency.CheckConsistencyPollingFuture)
212211
assert future._default_retry == kwargs.get("retry", gapic_v1.method.DEFAULT)
213212

214213
check_consistency_call = future._check_consistency_call
215-
assert type(check_consistency_call) == functools.partial
214+
assert isinstance(check_consistency_call, functools.partial)
216215

217216
assert check_consistency_call.func == client.check_consistency
218217
assert check_consistency_call.args == (expected_check_consistency_request,)

tests/unit/admin_overlay/test_consistency.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# try/except added for compatibility with python < 3.8
1717
try:
1818
from unittest import mock
19-
from unittest.mock import AsyncMock # pragma: NO COVER
2019
except ImportError: # pragma: NO COVER
2120
import mock
2221

@@ -61,15 +60,15 @@ def test_check_consistency_future_result():
6160
future = consistency.CheckConsistencyPollingFuture(check_consistency_call)
6261
is_consistent = future.result()
6362

64-
assert is_consistent == True
63+
assert is_consistent
6564
check_consistency_call.assert_has_calls(
6665
[mock.call(retry=future._default_retry)] * times
6766
)
6867

6968
# Check that calling result again doesn't produce more calls.
7069
is_consistent = future.result()
7170

72-
assert is_consistent == True
71+
assert is_consistent
7372
check_consistency_call.assert_has_calls(
7473
[mock.call(retry=future._default_retry)] * times
7574
)
@@ -84,7 +83,7 @@ def test_check_consistency_future_result_default_retry():
8483
)
8584
is_consistent = future.result()
8685

87-
assert is_consistent == True
86+
assert is_consistent
8887
check_consistency_call.assert_has_calls([mock.call(retry=retry)] * times)
8988

9089

tests/unit/admin_overlay/test_restore_table.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# try/except added for compatibility with python < 3.8
1616
try:
1717
from unittest import mock
18-
from unittest.mock import AsyncMock # pragma: NO COVER
1918
except ImportError: # pragma: NO COVER
2019
import mock
2120

@@ -135,7 +134,7 @@ def test_restore_table_operation_client_success_has_optimize():
135134
restore_table_operation.optimize_restored_table_operation()
136135
)
137136

138-
assert type(optimize_restored_table_operation) == operation.Operation
137+
assert isinstance(optimize_restored_table_operation, operation.Operation)
139138
assert (
140139
optimize_restored_table_operation._operation
141140
== OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO
@@ -170,7 +169,7 @@ def test_restore_table_operation_success_has_optimize_also_call_result():
170169
restore_table_operation.optimize_restored_table_operation()
171170
)
172171

173-
assert type(optimize_restored_table_operation) == operation.Operation
172+
assert isinstance(optimize_restored_table_operation, operation.Operation)
174173
assert (
175174
optimize_restored_table_operation._operation
176175
== OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO

0 commit comments

Comments
 (0)