Skip to content

Commit 86b069a

Browse files
committed
fix: Skip tests if SQLAlchemy in old_versions_test
1 parent b3ed91f commit 86b069a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/extensions/memory/test_structured_sqlite_session.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import tempfile
44
from pathlib import Path
5-
from typing import Any, cast
5+
from typing import Any, Optional, cast
66

77
import pytest
8+
9+
pytest.importorskip("sqlalchemy") # Skip tests if SQLAlchemy is not installed
810
from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails
911

1012
from agents import Agent, Runner, TResponseInputItem, function_tool
@@ -44,7 +46,9 @@ def usage_data() -> Usage:
4446
)
4547

4648

47-
def create_mock_run_result(usage: Usage | None = None, agent: Agent | None = None) -> RunResult:
49+
def create_mock_run_result(
50+
usage: Optional[Usage] = None, agent: Optional[Agent] = None
51+
) -> RunResult:
4852
"""Helper function to create a mock RunResult for testing."""
4953
if agent is None:
5054
agent = Agent(name="test", model=FakeModel())

0 commit comments

Comments
 (0)