Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit95bcc0f

Browse files
1 parent87fa112 commit95bcc0f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎google/api_core/retry.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ def retry_target(
204204
try:
205205
result=target()
206206
ifinspect.isawaitable(result):
207-
raiseexceptions.GoogleAPIError("Warning: Use google.api_core.retry_async.AsyncRetry for async calls!")
207+
raiseexceptions.GoogleAPIError(
208+
"Warning: Use google.api_core.retry_async.AsyncRetry for async calls!"
209+
)
208210
returnresult
209211

210212
# pylint: disable=broad-except

‎tests/asyncio/test_retry_async.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ async def test_retry_target_non_retryable_error(utcnow, sleep):
9696
assertexc_info.value==exception
9797
sleep.assert_not_called()
9898

99+
99100
@mock.patch("asyncio.sleep",autospec=True)
100101
@mock.patch(
101102
"google.api_core.datetime_helpers.utcnow",
@@ -105,7 +106,9 @@ async def test_retry_target_non_retryable_error(utcnow, sleep):
105106
@pytest.mark.asyncio
106107
asyncdeftest_retry_target_warning_for_retry(utcnow,sleep):
107108
predicate=retry.if_exception_type(exceptions.GoogleAPICallError)
108-
exception=exceptions.GoogleAPICallError("Warning: Use google.api_core.retry_async.AsyncRetry for async calls!")
109+
exception=exceptions.GoogleAPICallError(
110+
"Warning: Use google.api_core.retry_async.AsyncRetry for async calls!"
111+
)
109112
target=mock.Mock(side_effect=exception)
110113

111114
withpytest.raises(exceptions.GoogleAPICallError)asexc_info:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp