diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-11-16 06:27:43 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-11-16 06:57:07 +0530 |
commit | 6368e2e639bca7e66609911d2672b6a9dc65b052 (patch) | |
tree | ad1f2fb77baf1213e245511f6edfc6072ab606c5 /yt_dlp/extractor/common.py | |
parent | a4894d3e25943c4ecf4f38c0d50ce592d2175f29 (diff) |
[cleanup] Misc
Closes #5541
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 14984fd6f..3a1af3290 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -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( |