1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 08:35:32 +00:00

[cleanup] Misc

Closes #5541
This commit is contained in:
pukkandan
2022-11-16 06:27:43 +05:30
parent a4894d3e25
commit 6368e2e639
75 changed files with 194 additions and 156 deletions

View File

@ -3676,12 +3676,13 @@ class InfoExtractor:
@classmethod
def get_testcases(cls, include_onlymatching=False):
t = getattr(cls, '_TEST', None)
# Do not look in super classes
t = vars(cls).get('_TEST')
if t:
assert not hasattr(cls, '_TESTS'), f'{cls.ie_key()}IE has _TEST and _TESTS'
tests = [t]
else:
tests = getattr(cls, '_TESTS', [])
tests = vars(cls).get('_TESTS', [])
for t in tests:
if not include_onlymatching and t.get('only_matching', False):
continue
@ -3690,12 +3691,12 @@ class InfoExtractor:
@classmethod
def get_webpage_testcases(cls):
tests = getattr(cls, '_WEBPAGE_TESTS', [])
tests = vars(cls).get('_WEBPAGE_TESTS', [])
for t in tests:
t['name'] = cls.ie_key()
return tests
@classproperty
@classproperty(cache=True)
def age_limit(cls):
"""Get age limit from the testcases"""
return max(traverse_obj(