From 1a38e5a1896fc311e24d3b49965bb646cd30a34a Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Thu, 3 Jul 2025 00:07:47 -0700 Subject: [PATCH] fix tests --- tests/integration/conftest.py | 3 +++ tests/integration/plugins/test_throttle_protection.py | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index d586358c..b1d40434 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -265,6 +265,9 @@ def mock_download_collection_entries( patch.object( 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 yield diff --git a/tests/integration/plugins/test_throttle_protection.py b/tests/integration/plugins/test_throttle_protection.py index 696fa6bf..51f3cc23 100644 --- a/tests/integration/plugins/test_throttle_protection.py +++ b/tests/integration/plugins/test_throttle_protection.py @@ -1,10 +1,8 @@ from typing import Dict -from unittest.mock import patch import pytest 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.subscriptions.subscription import Subscription @@ -51,11 +49,6 @@ class TestThrottleProtectionPlugin: ) with ( - patch.object( - ThrottleProtectionPlugin, - "perform_sleep", - new=ThrottleProtectionPlugin.perform_sleep, - ), mock_download_collection_entries( is_youtube_channel=False, num_urls=1, is_extracted_audio=False ),