def METHOD_NAME(plugin):
    plugin.activate = CustomException.do_raise
    plugins.manager.install(plugin)
    with pytest.raises(CustomException):
        plugins.manager.activate(plugin)
    # make sure no registrations are in effect...
    _assert_hooks_not_registered(plugin)
    plugins.manager.deactivate(plugin)
    assert (not plugin._deactivate_called), 'Deactivate unexpectedly called!'