def mock_plugin(mocker): name = "mock_plugin" info = "useful" mocker.patch("mock_plugin.init") mocker.patch("mock_plugin.cleanup") plugins._load_plugin(name, info, os.path.abspath(".")) plugins.cleanup() yield plugins._loaded_plugins[name], info del plugins._loaded_plugins[name]
def test_do_not_fail_on_plugin_with_syntax_error(): name = "mock_plugin_syntax_error" info = "useful" plugins._load_plugin(name, info, os.path.abspath("."))
def test_do_not_fail_on_non_existing_plugin(): plugins._load_plugin("does_not_exist", "any info", os.path.abspath("."))
def load_plugin(name, info): plugins._load_plugin(name, info, plugins._app_plugin_directory)
def mock_plugin(): name = "mock_plugin" plugins._load_plugin(name, os.path.abspath(".")) plugins.cleanup() yield plugins._loaded_plugins[name] del plugins._loaded_plugins[name]