Skip to content

Commit 7108dc7

Browse files
committed
fix: resolve response handler CI checks
1 parent 24e31dd commit 7108dc7

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎python/packages/core/tests/workflow/test_checkpoint_unrestricted_pickle.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,10 @@ async def test_file_storage_rejects_unlisted_user_type_at_save():
300300
graph_signature_hash="hash",
301301
state={"data": _AllowedTestState(name="test", value=1)},
302302
)
303-
with pytest.raises(WorkflowCheckpointException, match="deserialization blocked|Unable to save|cannot be restored|cannot be encoded"):
303+
with pytest.raises(
304+
WorkflowCheckpointException,
305+
match="deserialization blocked|Unable to save|cannot be restored|cannot be encoded",
306+
):
304307
await storage.save(checkpoint)
305308
assert not await asyncio.to_thread(lambda: list(Path(tmpdir).glob("*.json")))
306309

‎python/packages/core/tests/workflow/test_executor_future.py‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import inspect
6-
from typing import Any, TypeVar
6+
from typing import TYPE_CHECKING, Any, TypeVar
77

88
import pytest
99
from pydantic import BaseModel
@@ -23,6 +23,15 @@ class MyTypeC(BaseModel):
2323
pass
2424

2525

26+
if TYPE_CHECKING:
27+
28+
class NonExistentType:
29+
pass
30+
31+
class MissingType:
32+
pass
33+
34+
2635
_T = TypeVar("_T")
2736

2837

@@ -143,7 +152,7 @@ class BadResponseHandler(Executor): # pyright: ignore[reportUnusedClass]
143152
@response_handler # pyright: ignore[reportUnknownArgumentType]
144153
async def handle_response(
145154
self,
146-
original_request: NonExistentType, # type: ignore[name-defined] # noqa: F821
155+
original_request: NonExistentType,
147156
response: int,
148157
ctx: WorkflowContext[MyTypeA, MyTypeB],
149158
) -> None:
@@ -171,7 +180,7 @@ def test_annotation_resolver_falls_back_to_raw_annotations(self):
171180
"""Test that annotation resolution preserves raw annotations when a hint is unresolved."""
172181
from agent_framework._workflows._typing_utils import _resolve_function_annotations
173182

174-
def sample(value: MissingType) -> None: # type: ignore[name-defined] # noqa: F821
183+
def sample(value: MissingType) -> None:
175184
pass
176185

177186
params = list(inspect.signature(sample).parameters.values())
@@ -189,5 +198,5 @@ def test_handler_unresolvable_annotation_raises(self):
189198

190199
class Bad(Executor): # pyright: ignore[reportUnusedClass]
191200
@handler # pyright: ignore[reportUnknownArgumentType]
192-
async def example(self, input: NonExistentType, ctx: WorkflowContext[MyTypeA, MyTypeB]) -> None: # type: ignore[name-defined] # ty: ignore[unresolved-reference] # noqa: F821
201+
async def example(self, input: NonExistentType, ctx: WorkflowContext[MyTypeA, MyTypeB]) -> None:
193202
pass

0 commit comments

Comments
 (0)