Skip to content

Commit 9b3609b

Browse files
committed
fix: linting
1 parent 1b027bb commit 9b3609b

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/strands/tools/decorator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,7 @@ async def stream(self, tool_use: ToolUse, invocation_state: dict[str, Any], **kw
629629
exception=e,
630630
)
631631

632-
def _wrap_tool_result(
633-
self, tool_use_d: str, result: Any, exception: Exception | None = None
634-
) -> ToolResultEvent:
632+
def _wrap_tool_result(self, tool_use_d: str, result: Any, exception: Exception | None = None) -> ToolResultEvent:
635633
# FORMAT THE RESULT for Strands Agent
636634
if isinstance(result, dict) and "status" in result and "content" in result:
637635
# Result is already in the expected format, just add toolUseId

src/strands/tools/executors/_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ async def _stream(
215215
return
216216
if structured_output_context.is_enabled:
217217
kwargs["structured_output_context"] = structured_output_context
218-
218+
219219
exception: Exception | None = None
220-
220+
221221
async for event in selected_tool.stream(tool_use, invocation_state, **kwargs):
222222
# Internal optimization; for built-in AgentTools, we yield TypedEvents out of .stream()
223223
# so that we don't needlessly yield ToolStreamEvents for non-generator callbacks.

tests/strands/agent/test_agent_result.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,3 @@ def test__str__empty_interrupts_returns_agent_message(mock_metrics, simple_messa
370370

371371
# Empty list is falsy, should fall through to text content
372372
assert message_string == "Hello world!\n"
373-

tests/strands/tools/executors/test_executor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ def success_tool():
551551
assert isinstance(after_event, AfterToolCallEvent)
552552
assert after_event.exception is None
553553
assert after_event.result["status"] == "success"
554+
555+
556+
@pytest.mark.asyncio
554557
async def test_executor_stream_no_retry_set(executor, agent, tool_results, invocation_state, alist):
555558
"""Test default behavior when retry is not set - tool executes once."""
556559
call_count = {"count": 0}

tests/strands/tools/test_decorator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ async def test_tool_result_event_carries_exception_assertion_error(alist):
18901890
@strands.tool
18911891
def assertion_error_tool():
18921892
"""Tool that raises an AssertionError."""
1893-
assert False, "unexpected assertion failure"
1893+
raise AssertionError("unexpected assertion failure")
18941894

18951895
tool_use = {"toolUseId": "test-id", "input": {}}
18961896
events = await alist(assertion_error_tool.stream(tool_use, {}))

0 commit comments

Comments
 (0)