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:
parent
3cbf15a107
commit
061b27f329
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user