From 6368e2e639bca7e66609911d2672b6a9dc65b052 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 16 Nov 2022 06:27:43 +0530 Subject: [cleanup] Misc Closes #5541 --- yt_dlp/extractor/common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'yt_dlp/extractor/common.py') 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( -- cgit v1.2.3