refactor plugin loading options to prepare for --require-plugins

This commit is contained in:
Anthony Sottile 2022-01-10 20:03:25 -05:00
parent 6abefff89e
commit 1b58293ad3
5 changed files with 59 additions and 29 deletions

View file

@ -90,7 +90,8 @@ def mock_file_checker_with_plugin(plugin_target):
),
),
]
plugins = finder.load_plugins(to_load, [], set())
opts = finder.PluginOptions(frozenset())
plugins = finder.load_plugins(to_load, [], opts)
# Prevent it from reading lines from stdin or somewhere else
with mock.patch(

View file

@ -55,7 +55,8 @@ def test_enable_local_plugin_from_config(local_config):
cfg, cfg_dir = config.load_config(local_config, [], isolated=False)
plugins = finder.find_plugins(cfg)
plugin_paths = finder.find_local_plugin_paths(cfg, cfg_dir)
loaded_plugins = finder.load_plugins(plugins, plugin_paths, set())
opts = finder.PluginOptions(frozenset())
loaded_plugins = finder.load_plugins(plugins, plugin_paths, opts)
(custom_extension,) = (
loaded
@ -82,8 +83,8 @@ def test_local_plugin_can_add_option(local_config):
plugins = finder.find_plugins(cfg)
plugin_paths = finder.find_local_plugin_paths(cfg, cfg_dir)
enabled = finder.parse_enabled(cfg, stage1_args.enable_extensions)
loaded_plugins = finder.load_plugins(plugins, plugin_paths, enabled)
opts = finder.PluginOptions(frozenset())
loaded_plugins = finder.load_plugins(plugins, plugin_paths, opts)
option_manager = OptionManager(
version="123",