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