jscheffl commented on code in PR #58033:
URL: https://github.com/apache/airflow/pull/58033#discussion_r2529031961
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/utils/test_pod_manager.py:
##########
@@ -59,30 +63,38 @@ def test_parse_log_line():
assert line == log_message
+class DummyRetryState:
+ def __init__(self, exception=None):
+ # self.attempt_number = 1
+ self.outcome = mock.Mock() if exception is not None else None
+ if self.outcome:
+ self.outcome.exception = mock.Mock(return_value=exception)
+
+
+def test_get_retry_after_seconds_with_retry_after_header():
+ exc = ApiException(status=429)
+ exc.headers = {"Retry-After": "15"}
+ retry_state = DummyRetryState(exception=exc)
+ wait = get_retry_after_seconds(retry_state)
+ assert wait == 15
+
+
[email protected](("attempt_number, expected_wait"), [(1, 1), (4, 8)])
Review Comment:
We upgraded to pytest 9.0.0 and now ruff is a bit more picky... (I
believe...)
```suggestion
@pytest.mark.parametrize((("attempt_number", "expected_wait")), [(1, 1), (4,
8)])
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]