Skip to content

Commit e0bd1fa

Browse files
committed
fix: ruff unused imports, catch concurrent.futures.TimeoutError explicitly
1 parent 27c77e3 commit e0bd1fa

4 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/hawk/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _run_step_with_timeout(self, s: Step, input_val: Any) -> Any:
113113
future = pool.submit(self._run_step_sync, s, input_val)
114114
try:
115115
return future.result(timeout=s.timeout)
116-
except TimeoutError:
116+
except concurrent.futures.TimeoutError:
117117
raise TimeoutError(
118118
f"Step '{s.name}' timed out after {s.timeout}s"
119119
) from None

tests/test_evaluate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from dataclasses import dataclass
65
from unittest.mock import AsyncMock, MagicMock
76

87
import pytest

tests/test_memory_tools.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
import json
65
from unittest.mock import MagicMock
76

87
from hawk.memory_tools import MemoryTools

tests/test_tracing.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from unittest.mock import MagicMock, patch
5+
from unittest.mock import patch
66

77
import hawk.tracing as tracing
88
from hawk.tracing import (
@@ -182,7 +182,6 @@ class TestTraceChatAsyncDecorator:
182182
"""Tests for @trace_chat on async functions."""
183183

184184
async def test_async_passthrough_when_disabled(self) -> None:
185-
import asyncio
186185

187186
tracing._tracing_enabled = False
188187

@@ -194,7 +193,6 @@ async def my_chat(message: str) -> str:
194193
assert result == "Async: hello"
195194

196195
async def test_async_preserves_name(self) -> None:
197-
import asyncio
198196

199197
tracing._tracing_enabled = False
200198

@@ -209,7 +207,6 @@ class TestTraceToolAsyncDecorator:
209207
"""Tests for @trace_tool on async functions."""
210208

211209
async def test_async_passthrough_when_disabled(self) -> None:
212-
import asyncio
213210

214211
tracing._tracing_enabled = False
215212

@@ -221,7 +218,6 @@ async def my_tool(query: str) -> str:
221218
assert result == "Result: search"
222219

223220
async def test_async_exception_propagates(self) -> None:
224-
import asyncio
225221

226222
import pytest
227223

0 commit comments

Comments
 (0)