diff --git a/google/api_core/retry.py b/google/api_core/retry.py index a1d1f182..446d43c0 100644 --- a/google/api_core/retry.py +++ b/google/api_core/retry.py @@ -288,6 +288,10 @@ def retry_wrapped_func(*args, **kwargs): return retry_wrapped_func + @property + def deadline(self): + return self._deadline + def with_deadline(self, deadline): """Return a copy of this retry with the given deadline. diff --git a/tests/unit/test_retry.py b/tests/unit/test_retry.py index be0c6880..a0160e90 100644 --- a/tests/unit/test_retry.py +++ b/tests/unit/test_retry.py @@ -162,6 +162,7 @@ def test_constructor_defaults(self): assert retry_._multiplier == 2 assert retry_._deadline == 120 assert retry_._on_error is None + assert retry_.deadline == 120 def test_constructor_options(self): _some_function = mock.Mock()