build(features/steps): fix 14 files to match new ruff format
CI / lint (pull_request) Failing after 16s
CI / typecheck (pull_request) Successful in 27s
CI / coverage (pull_request) Has been skipped
CI / security (pull_request) Successful in 19s
CI / quality (pull_request) Failing after 15s
CI / behave (3.11) (pull_request) Failing after 11s
CI / behave (3.12) (pull_request) Failing after 10s
CI / behave (3.13) (pull_request) Failing after 14s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / build (pull_request) Failing after 13s
CI / lint (pull_request) Failing after 16s
CI / typecheck (pull_request) Successful in 27s
CI / coverage (pull_request) Has been skipped
CI / security (pull_request) Successful in 19s
CI / quality (pull_request) Failing after 15s
CI / behave (3.11) (pull_request) Failing after 11s
CI / behave (3.12) (pull_request) Failing after 10s
CI / behave (3.13) (pull_request) Failing after 14s
CI / docker (pull_request) Has been skipped
CI / helm (pull_request) Has been skipped
CI / build (pull_request) Failing after 13s
This commit is contained in:
@@ -121,27 +121,27 @@ def step_apply_async_exponential_retry(context, max_attempts):
|
||||
@then("the function should eventually succeed")
|
||||
def step_verify_function_succeeded(context):
|
||||
"""Verify function succeeded after retries."""
|
||||
assert (
|
||||
context.retry_succeeded
|
||||
), f"Function failed: {getattr(context, 'retry_error', 'Unknown error')}"
|
||||
assert context.retry_succeeded, (
|
||||
f"Function failed: {getattr(context, 'retry_error', 'Unknown error')}"
|
||||
)
|
||||
assert context.result == "success"
|
||||
|
||||
|
||||
@then("the async function should eventually succeed")
|
||||
def step_verify_async_function_succeeded(context):
|
||||
"""Verify async function succeeded after retries."""
|
||||
assert (
|
||||
context.retry_succeeded
|
||||
), f"Async function failed: {getattr(context, 'retry_error', 'Unknown error')}"
|
||||
assert context.retry_succeeded, (
|
||||
f"Async function failed: {getattr(context, 'retry_error', 'Unknown error')}"
|
||||
)
|
||||
assert context.result == "async success"
|
||||
|
||||
|
||||
@then("the function should be called {expected_calls:d} times")
|
||||
def step_verify_call_count(context, expected_calls):
|
||||
"""Verify function was called expected number of times."""
|
||||
assert (
|
||||
context.call_count == expected_calls
|
||||
), f"Expected {expected_calls} calls, got {context.call_count}"
|
||||
assert context.call_count == expected_calls, (
|
||||
f"Expected {expected_calls} calls, got {context.call_count}"
|
||||
)
|
||||
|
||||
|
||||
# Network retry pattern tests
|
||||
@@ -182,9 +182,9 @@ def step_verify_network_retry(context):
|
||||
@then("the function should be called {max_calls:d} times maximum")
|
||||
def step_verify_max_calls(context, max_calls):
|
||||
"""Verify function wasn't called more than max times."""
|
||||
assert (
|
||||
context.call_count <= max_calls
|
||||
), f"Function called {context.call_count} times, max is {max_calls}"
|
||||
assert context.call_count <= max_calls, (
|
||||
f"Function called {context.call_count} times, max is {max_calls}"
|
||||
)
|
||||
|
||||
|
||||
# Provider retry pattern tests
|
||||
@@ -261,18 +261,18 @@ def step_apply_file_retry(context):
|
||||
@then("the file operation should eventually succeed")
|
||||
def step_verify_file_retry_success(context):
|
||||
"""Verify the file operation eventually succeeds."""
|
||||
assert (
|
||||
context.file_retry_succeeded
|
||||
), f"File retry failed: {getattr(context, 'file_retry_error', 'Unknown error')}"
|
||||
assert context.file_retry_succeeded, (
|
||||
f"File retry failed: {getattr(context, 'file_retry_error', 'Unknown error')}"
|
||||
)
|
||||
assert context.file_result == "file success"
|
||||
|
||||
|
||||
@then("the file operation should be invoked {expected:d} times")
|
||||
def step_verify_file_retry_invocations(context, expected):
|
||||
"""Verify the file operation was invoked the expected number of times."""
|
||||
assert (
|
||||
context.file_call_count == expected
|
||||
), f"Expected {expected} calls, got {context.file_call_count}"
|
||||
assert context.file_call_count == expected, (
|
||||
f"Expected {expected} calls, got {context.file_call_count}"
|
||||
)
|
||||
|
||||
|
||||
# Circuit breaker tests
|
||||
@@ -496,9 +496,9 @@ def step_async_retry_context_manager_failure(context):
|
||||
@then("the async retry context manager should capture the exception")
|
||||
def step_verify_async_retry_context_manager_capture(context):
|
||||
"""Ensure the async retry context manager captured the exception."""
|
||||
assert (
|
||||
context.async_retry_context_manager_error
|
||||
), "Expected async runtime error to propagate"
|
||||
assert context.async_retry_context_manager_error, (
|
||||
"Expected async runtime error to propagate"
|
||||
)
|
||||
assert context.retry_context_errors_added_async >= 1
|
||||
assert isinstance(context.retry_context.errors[-1], Exception)
|
||||
|
||||
@@ -690,9 +690,9 @@ def step_apply_retry_on_result(context, max_attempts):
|
||||
@then("the decorated function should return the successful payload")
|
||||
def step_verify_retry_on_result_payload(context):
|
||||
"""Ensure retry_on_result eventually returns the non-retry payload."""
|
||||
assert (
|
||||
context.retry_on_result_succeeded
|
||||
), f"Retry on result failed: {context.retry_on_result_output}"
|
||||
assert context.retry_on_result_succeeded, (
|
||||
f"Retry on result failed: {context.retry_on_result_output}"
|
||||
)
|
||||
assert isinstance(context.retry_on_result_output, dict)
|
||||
assert context.retry_on_result_output.get("retry") is False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user