Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test: migrate residual session factories to shared SQLite (#40665)
Asuka Minato616736e0f158
diff --git a/api/tests/unit_tests/commands/test_data_migration_commands.py b/api/tests/unit_tests/commands/test_data_migration_commands.pyindex cafb107536e..f09668463e7 100644--- a/api/tests/unit_tests/commands/test_data_migration_commands.py+++ b/api/tests/unit_tests/commands/test_data_migration_commands.py@@ -108,7 +108,6 @@ def test_export_command_uses_cli_owned_session(monkeypatch, tmp_path: Path, sqlicaptured["path"] = pathcaptured["overwrite"] = overwrite- monkeypatch.setattr(data_migration.session_factory, "create_session", lambda: Session(sqlite_engine))monkeypatch.setattr(data_migration, "MigrationExportService", FakeMigrationExportService)monkeypatch.setattr(data_migration, "MigrationPackageService", FakeMigrationPackageService)@@ -153,7 +152,6 @@ def test_import_command_uses_cli_owned_session(monkeypatch, tmp_path: Path, sqlicaptured["path"] = pathreturn package- monkeypatch.setattr(data_migration.session_factory, "create_session", lambda: Session(sqlite_engine))monkeypatch.setattr(data_migration, "MigrationImportService", FakeMigrationImportService)monkeypatch.setattr(data_migration, "MigrationPackageService", FakeMigrationPackageService)diff --git a/api/tests/unit_tests/controllers/openapi/test_workspaces_members.py b/api/tests/unit_tests/controllers/openapi/test_workspaces_members.pyindex 13176cc3b27..a5cd7ca5b9c 100644--- a/api/tests/unit_tests/controllers/openapi/test_workspaces_members.py+++ b/api/tests/unit_tests/controllers/openapi/test_workspaces_members.py@@ -22,14 +22,14 @@ import jsonimport uuidfrom datetime import UTC, datetimefrom types import SimpleNamespace-from unittest.mock import Mock, patch+from unittest.mock import Mockimport pytestfrom flask import Flaskfrom flask.views import MethodViewfrom pydantic import ValidationError-from sqlalchemy import Engine, select-from sqlalchemy.orm import Session, sessionmaker+from sqlalchemy import select+from sqlalchemy.orm import Sessionfrom werkzeug.exceptions import BadRequest, NotFound, UnprocessableEntityfrom controllers.openapi import bp as openapi_bp@@ -45,7 +45,6 @@ from controllers.openapi.workspaces import (from libs.oauth_bearer import AuthContext, Scope, SubjectType, TokenType, reset_auth_ctx, set_auth_ctxfrom models import Account, Tenant, TenantAccountJoinfrom models.account import AccountStatus, TenantAccountRole, TenantStatus-from models.base import TypeBasefrom services.account_service import TenantService as RealTenantServicefrom services.errors.account import (AccountAlreadyInTenantError,@@ -92,14 +91,8 @@ def openapi_app() -> Flask:@pytest.fixture-def database_session(sqlite_engine: Engine):- models = (Account, Tenant, TenantAccountJoin)- tables = [model.metadata.tables[model.__tablename__] for model in models]- TypeBase.metadata.create_all(sqlite_engine, tables=tables)- session_maker = sessionmaker(bind=sqlite_engine, expire_on_commit=False)- factory = SimpleNamespace(get_session_maker=lambda: session_maker, create_session=session_maker)- with patch("controllers.common.session.session_factory", factory), session_maker() as session:- yield session+def database_session(sqlite_session: Session):+ return sqlite_sessiondef _rule(app: Flask, path: str):