Skip to content

Commit 7be1e59

Browse files
mf2199MaxxleLLCcrwilcox
authored
feat: [CBT-6 helper] Exposing Retry._deadline as a property (googleapis#20)
* Retry._deadline exposed as a property * feat Retry._deadline exposed as a property * added property test Co-authored-by: q-logic <[email protected]> Co-authored-by: Christopher Wilcox <[email protected]>
1 parent e4eaec0 commit 7be1e59

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

google/api_core/retry.py

Lines 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

Lines 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)