diff --git a/devscripts/run_tests.py b/devscripts/run_tests.py index cf33d443df..e39aa7af02 100755 --- a/devscripts/run_tests.py +++ b/devscripts/run_tests.py @@ -51,7 +51,7 @@ def run_tests(*tests, pattern=None, ci=False, load_plugins=False): try: return subprocess.call(arguments, env={ **os.environ, - 'YTDLP_NO_PLUGINS': '1' if os.environ.get('YTDLP_NO_PLUGINS') or not load_plugins else '', + '_YT_DLP_TEST_DO_LOAD_PLUGINS': '1' if load_plugins else '', }) except FileNotFoundError: pass diff --git a/test/helper.py b/test/helper.py index 72e784ffbf..e999993fb1 100644 --- a/test/helper.py +++ b/test/helper.py @@ -1,6 +1,7 @@ import errno import hashlib import json +import os import os.path import re import ssl @@ -87,8 +88,9 @@ def report_warning(self, message, *args, **kwargs): def gettestcases(include_onlymatching=False): - import yt_dlp.plugins - yt_dlp.plugins.load_all_plugins() + if os.environ.get('_YT_DLP_TEST_DO_LOAD_PLUGINS'): + import yt_dlp.plugins as plugins + plugins.load_all_plugins() for ie in yt_dlp.extractor.gen_extractors(): yield from ie.get_testcases(include_onlymatching)