Skip to content

Commit a9d4ff8

Browse files
committed
fix lint issues
1 parent 412ebb1 commit a9d4ff8

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/extensions/memory/test_sqlalchemy_session.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
from __future__ import annotations
22

33
import json
4+
from collections.abc import Iterable, Sequence
45
from contextlib import asynccontextmanager
56
from datetime import datetime, timedelta
6-
from typing import Any, Dict, Iterable, Sequence, cast
7+
from typing import Any, cast
78

89
import pytest
10+
from openai.types.responses.response_output_message_param import ResponseOutputMessageParam
11+
from openai.types.responses.response_output_text_param import ResponseOutputTextParam
12+
from openai.types.responses.response_reasoning_item_param import (
13+
ResponseReasoningItemParam,
14+
Summary,
15+
)
916
from sqlalchemy import select, text, update
1017
from sqlalchemy.sql import Select
1118

@@ -15,12 +22,6 @@
1522
from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession
1623
from tests.fake_model import FakeModel
1724
from tests.test_responses import get_text_message
18-
from openai.types.responses.response_output_message_param import ResponseOutputMessageParam
19-
from openai.types.responses.response_output_text_param import ResponseOutputTextParam
20-
from openai.types.responses.response_reasoning_item_param import (
21-
ResponseReasoningItemParam,
22-
Summary,
23-
)
2425

2526
# Mark all tests in this file as asyncio
2627
pytestmark = pytest.mark.asyncio
@@ -58,7 +59,7 @@ def _make_reasoning_item(item_id: str, summary_text: str) -> TResponseInputItem:
5859
def _item_ids(items: Sequence[TResponseInputItem]) -> list[str]:
5960
result: list[str] = []
6061
for item in items:
61-
item_dict = cast(Dict[str, Any], item)
62+
item_dict = cast(dict[str, Any], item)
6263
result.append(cast(str, item_dict["id"]))
6364
return result
6465

@@ -332,7 +333,7 @@ async def test_pop_item_same_timestamp_returns_latest():
332333

333334
popped = await session.pop_item()
334335
assert popped is not None
335-
assert cast(Dict[str, Any], popped)["id"] == "msg_pop_same_ts"
336+
assert cast(dict[str, Any], popped)["id"] == "msg_pop_same_ts"
336337

337338
remaining = await session.get_items()
338339
assert _item_ids(remaining) == ["rs_pop_same_ts"]

0 commit comments

Comments
 (0)