def test_on_config_changed(configdata_init, hook, module, option_filter, option, called): module.info.config_changed_hooks = [(option_filter, hook)] info = loader.ExtensionInfo(name='testmodule') loader._load_component(info) loader._on_config_changed(option) assert hook.called == called
def test_skip_hooks(hook, module): hook.raising = True module.info.init_hook = hook module.info.config_changed_hooks = [(None, hook)] info = loader.ExtensionInfo(name='testmodule') loader._load_component(info, skip_hooks=True) loader._on_config_changed('test') assert not hook.called