From 823f3fb8a32268d446c1b036c39b675b7e7c0454 Mon Sep 17 00:00:00 2001 From: CI Bot Date: Thu, 13 Aug 2026 20:34:05 +0800 Subject: [PATCH] test: revert test_batch_download.py to develop original (no changes needed) --- tests/unit/test_batch_download.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tests/unit/test_batch_download.py b/tests/unit/test_batch_download.py index 345917875..58c669bce 100755 --- a/tests/unit/test_batch_download.py +++ b/tests/unit/test_batch_download.py @@ -7,7 +7,6 @@ and _download_video_to_file helper. from __future__ import annotations import io -import sys import zipfile from pathlib import Path from unittest.mock import MagicMock, patch @@ -245,19 +244,7 @@ def test_batch_download_single_video(): def test_batch_download_session_closed(): - """DB session is always closed (via finally block). - - NOTE: Some prior tests in the full suite replace sys.modules['worker_app.db'] - with a MagicMock, causing 'from worker_app.db import SessionLocal' to get a - mock. We ensure the real module is restored before testing. - """ - # Restore real worker_app.db module if it was mocked by a prior test - import types - if not isinstance(sys.modules.get("worker_app.db"), types.ModuleType): - # Remove the mock and re-import the real module - sys.modules.pop("worker_app.db", None) - import worker_app.db # noqa: F401 — re-import real module - + """DB session is always closed (via finally block).""" videos = [_FakeVideo("v1", "v.mp4")] session = MagicMock()