Allow for page_suitable() extraction in tests
This commit is contained in:
parent
fc92c793d2
commit
88b767d8e2
@ -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
|
||||
|
||||
|
@ -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'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user