Skip to content

test: use sqlite3 session in test_tool_file_manager#38771

Open
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:sqlite3-core-tools-test_tool_file_manager
Open

test: use sqlite3 session in test_tool_file_manager#38771
asukaminato0721 wants to merge 1 commit into
langgenius:mainfrom
asukaminato0721:sqlite3-core-tools-test_tool_file_manager

Conversation

@asukaminato0721

Copy link
Copy Markdown
Contributor

Replace mocked SQLAlchemy session/context/factory and fake ToolFile/MessageFile rows with real SQLite-bound sessions and persisted models. Verify create, retrieval, missing-file, message lookup, and streaming behavior while retaining storage and HTTP mocks. Part of #32454.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-07-10 16:41:25.598392973 +0000
+++ /tmp/pyrefly_pr.txt	2026-07-10 16:41:13.898282830 +0000
@@ -5433,8 +5433,8 @@
    --> tests/unit_tests/core/tools/test_tool_engine.py:266:21
 ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.tools.tool_engine.ToolEngine.agent_invoke` [bad-argument-type]
    --> tests/unit_tests/core/tools/test_tool_engine.py:310:21
-ERROR Argument `Generator[Unknown] | None` is not assignable to parameter `iterable` with type `Iterable[Unknown]` in function `list.__init__` [bad-argument-type]
-   --> tests/unit_tests/core/tools/test_tool_file_manager.py:272:25
+ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
+  --> tests/unit_tests/core/tools/test_tool_file_manager.py:30:56
 ERROR `SimpleNamespace` is not assignable to attribute `entity` with type `ToolProviderEntityWithPlugin` [bad-assignment]
    --> tests/unit_tests/core/tools/test_tool_manager.py:300:32
 ERROR Argument `SimpleNamespace` is not assignable to parameter `agent_tool` with type `AgentToolEntity` in function `core.tools.tool_manager.ToolManager.get_agent_tool_runtime` [bad-argument-type]

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 52.85% 52.86% +0.01%
Strict coverage 52.36% 52.37% +0.01%
Typed symbols 32,803 32,817 +14
Untyped symbols 29,539 29,539 0
Modules 2988 2988 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant