summaryrefslogtreecommitdiffstats
path: root/test/test_downloader.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-09-07 18:33:19 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2024-09-07 18:33:19 -0400
commit1f3ffe32342852fd9ea9e7704022488f3a1222bd (patch)
treecb255a091b73e96840de0f6f44b36dff1acab4b9 /test/test_downloader.py
parentb5e56c51e491b41f9eb6a895459c185788a377e5 (diff)
New upstream version 1.27.4.upstream/1.27.4
Diffstat (limited to 'test/test_downloader.py')
-rw-r--r--test/test_downloader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_downloader.py b/test/test_downloader.py
index f88b2c0..35cccc4 100644
--- a/test/test_downloader.py
+++ b/test/test_downloader.py
@@ -45,11 +45,15 @@ class TestDownloaderModule(unittest.TestCase):
@classmethod
def setUpClass(cls):
# allow import of ytdl downloader module without youtube_dl installed
+ cls._orig_ytdl = sys.modules.get("youtube_dl")
sys.modules["youtube_dl"] = MagicMock()
@classmethod
def tearDownClass(cls):
- del sys.modules["youtube_dl"]
+ if cls._orig_ytdl:
+ sys.modules["youtube_dl"] = cls._orig_ytdl
+ else:
+ del sys.modules["youtube_dl"]
def tearDown(self):
downloader._cache.clear()