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

Appearance settings

Commit 7be1e59

Browse filesBrowse files
mf2199MaxxleLLCcrwilcox
authored
feat: [CBT-6 helper] Exposing Retry._deadline as a property (#20)
* Retry._deadline exposed as a property * feat Retry._deadline exposed as a property * added property test Co-authored-by: q-logic <52290913+q-logic@users.noreply.github.com> Co-authored-by: Christopher Wilcox <crwilcox@google.com>
1 parent e4eaec0 commit 7be1e59
Copy full SHA for 7be1e59

File tree

Expand file treeCollapse file tree

2 files changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-0
lines changed

‎google/api_core/retry.py

Copy file name to clipboardExpand all lines: google/api_core/retry.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ def retry_wrapped_func(*args, **kwargs):
288288

289289
return retry_wrapped_func
290290

291+
@property
292+
def deadline(self):
293+
return self._deadline
294+
291295
def with_deadline(self, deadline):
292296
"""Return a copy of this retry with the given deadline.
293297

‎tests/unit/test_retry.py

Copy file name to clipboardExpand all lines: tests/unit/test_retry.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def test_constructor_defaults(self):
162162
assert retry_._multiplier == 2
163163
assert retry_._deadline == 120
164164
assert retry_._on_error is None
165+
assert retry_.deadline == 120
165166

166167
def test_constructor_options(self):
167168
_some_function = mock.Mock()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.