Skip to content

Commit 8cf3e3f

Browse files
committed
fix lint errors
1 parent 9885dd0 commit 8cf3e3f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

google/cloud/storage/_experimental/asyncio/retry/bidi_stream_retry_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
from google.cloud.storage._experimental.asyncio.retry.base_strategy import (
2020
_BaseResumptionStrategy,
2121
)
22+
23+
2224
class _BidiStreamRetryManager:
2325
"""Manages the generic retry loop for a bidi streaming operation."""
26+
2427
def __init__(
2528
self,
2629
strategy: _BaseResumptionStrategy,
@@ -34,6 +37,7 @@ def __init__(
3437
"""
3538
self._strategy = strategy
3639
self._stream_opener = stream_opener
40+
3741
async def execute(self, initial_state: Any, retry_policy):
3842
"""
3943
Executes the bidi operation with the configured retry policy.

tests/unit/asyncio/retry/test_bidi_stream_retry_manager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
from google.api_core import exceptions
2020
from google.api_core.retry_async import AsyncRetry
2121

22-
from google.cloud.storage._experimental.asyncio.retry import bidi_stream_retry_manager as manager
22+
from google.cloud.storage._experimental.asyncio.retry import (
23+
bidi_stream_retry_manager as manager,
24+
)
2325
from google.cloud.storage._experimental.asyncio.retry import base_strategy
2426

2527

2628
def _is_retriable(exc):
2729
return isinstance(exc, exceptions.ServiceUnavailable)
2830

31+
2932
DEFAULT_TEST_RETRY = AsyncRetry(predicate=_is_retriable, deadline=1)
3033

3134

@@ -147,6 +150,8 @@ async def mock_stream_opener(*args, **kwargs):
147150
strategy=mock_strategy, stream_opener=mock_stream_opener
148151
)
149152
with pytest.raises(exceptions.PermissionDenied):
150-
await retry_manager.execute(initial_state={}, retry_policy=DEFAULT_TEST_RETRY)
153+
await retry_manager.execute(
154+
initial_state={}, retry_policy=DEFAULT_TEST_RETRY
155+
)
151156

152157
mock_strategy.recover_state_on_failure.assert_not_called()

0 commit comments

Comments
 (0)