1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-06-02 02:19:29 +00:00

Condense filters

Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
This commit is contained in:
dirkf 2023-01-28 18:15:41 +00:00 committed by GitHub
parent 5ab2dbeced
commit e48a9ae20e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -310,13 +310,12 @@ def gen_test_suite(ie_key):
for ie_key in set(
map(lambda x: x[0],
map(lambda a: a[5:],
filter(
lambda x: callable(x[1]),
map(lambda a: (a[5:], getattr(TestDownload, a, None)),
filter(lambda t:
re.match(r'test_.+(?<!(?:_all|.._\d|._\d\d|_\d\d\d))$', t),
dir(TestDownload)))))):
lambda x: callable(getattr(TestDownload, x, None)),
filter(
lambda t: re.match(r"test_.+(?<!(?:_all|.._\d|._\d\d|_\d\d\d))$", t),
dir(TestDownload))))):
test_all = gen_test_suite(ie_key)
TestDownload.addTest(test_all, 'test_%s_all' % ie_key, 'Test all: %s' % ie_key)