From d912aa011a783b0b8d2ad10f5c9bbe26d87fc86d Mon Sep 17 00:00:00 2001 From: dirkf Date: Mon, 2 Oct 2023 04:35:32 +0100 Subject: [PATCH] [test] Only limit playlist test when `playlist_mincount` is the only count tested * eg not when `playlist_count` is specified * avoid `playlist_mincount` if a `lambda` test may test the count --- test/test_download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_download.py b/test/test_download.py index e0bc8cb95..71708788f 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -35,6 +35,7 @@ from youtube_dl.utils import ( ExtractorError, error_to_compat_str, format_bytes, + traverse_obj, UnavailableVideoError, ) from youtube_dl.extractor import get_info_extractor @@ -122,7 +123,8 @@ def generator(test_case, tname): params['outtmpl'] = tname + '_' + params['outtmpl'] if is_playlist and 'playlist' not in test_case: params.setdefault('extract_flat', 'in_playlist') - params.setdefault('playlistend', test_case.get('playlist_mincount')) + if traverse_obj(test_case, 'playlist_count', 'playlist_maxcount', default=-1) < 0: + params.setdefault('playlistend', test_case.get('playlist_mincount')) params.setdefault('skip_download', True) ydl = YoutubeDL(params, auto_init=False)