fix tests

This commit is contained in:
Jesse Bannon 2025-07-03 00:07:47 -07:00
parent c004ec3b0b
commit 1a38e5a189
2 changed files with 3 additions and 7 deletions

View file

@ -265,6 +265,9 @@ def mock_download_collection_entries(
patch.object( patch.object(
MultiUrlDownloader, "_extract_entry_info_with_retry", new=lambda _, entry: entry MultiUrlDownloader, "_extract_entry_info_with_retry", new=lambda _, entry: entry
), ),
# Throttle protection is included in all prebuilt presets. Mock the sleep avoid
# actual sleeps
patch.object(ThrottleProtectionPlugin, "perform_sleep", new=lambda _1, _2: None),
): ):
# Stub out metadata. TODO: update this if we do metadata plugins # Stub out metadata. TODO: update this if we do metadata plugins
yield yield

View file

@ -1,10 +1,8 @@
from typing import Dict from typing import Dict
from unittest.mock import patch
import pytest import pytest
from conftest import assert_logs from conftest import assert_logs
from ytdl_sub.plugins.throttle_protection import ThrottleProtectionPlugin
from ytdl_sub.plugins.throttle_protection import logger as throttle_protection_logger from ytdl_sub.plugins.throttle_protection import logger as throttle_protection_logger
from ytdl_sub.subscriptions.subscription import Subscription from ytdl_sub.subscriptions.subscription import Subscription
@ -51,11 +49,6 @@ class TestThrottleProtectionPlugin:
) )
with ( with (
patch.object(
ThrottleProtectionPlugin,
"perform_sleep",
new=ThrottleProtectionPlugin.perform_sleep,
),
mock_download_collection_entries( mock_download_collection_entries(
is_youtube_channel=False, num_urls=1, is_extracted_audio=False is_youtube_channel=False, num_urls=1, is_extracted_audio=False
), ),