Allow for page_suitable() extraction in tests

This commit is contained in:
df 2021-09-11 10:36:05 +01:00
parent fc92c793d2
commit 88b767d8e2
2 changed files with 4 additions and 2 deletions

View File

@ -89,8 +89,10 @@ class FakeYDL(YoutubeDL):
self.report_warning = types.MethodType(report_warning, self)
def gettestcases(include_onlymatching=False):
def gettestcases(include_onlymatching=False, include_pagesuitable=True):
for ie in youtube_dl.extractor.gen_extractors():
if not include_pagesuitable and callable(getattr(ie, 'page_suitable', None)):
continue
for tc in ie.get_testcases(include_onlymatching):
yield tc

View File

@ -76,7 +76,7 @@ class TestAllURLsMatching(unittest.TestCase):
def test_no_duplicates(self):
ies = gen_extractors()
for tc in gettestcases(include_onlymatching=True):
for tc in gettestcases(include_onlymatching=True, include_pagesuitable=False):
url = tc['url']
for ie in ies:
if type(ie).__name__ in ('GenericIE', tc['name'] + 'IE'):