1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-24 03:32:33 +01:00

[tests] detect calls to 'request()' during initialization (#6387)

This commit is contained in:
Mike Fährmann 2024-10-27 20:08:50 +01:00
parent 3cbf15a107
commit 061b27f329
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -168,12 +168,17 @@ class TestExtractorModule(unittest.TestCase):
def test_init(self):
"""Test for exceptions in Extractor.initialize() and .finalize()"""
def fail_request(*args, **kwargs):
self.fail("called 'request() during initialization")
for cls in extractor.extractors():
if cls.category == "ytdl":
continue
extr = cls.from_url(cls.example)
if not extr and cls.basecategory and not cls.instances:
continue
extr.request = fail_request
extr.initialize()
extr.finalize()