def METHOD_NAME(jp_serverapp, has_app):
    name = "tests.extension.mockextensions.app"
    with mock.patch(
        "tests.extension.mockextensions.app.MockExtensionApp.initialize_handlers",
        side_effect=RuntimeError,
    ):
        manager = ExtensionManager(serverapp=jp_serverapp if has_app else None)
        manager.add_extension(name, enabled=True)
        manager.link_extension(name)
        manager.load_extension(name)  # should only warn
        jp_serverapp.reraise_server_extension_failures = True
        if has_app:
            with pytest.raises(RuntimeError):
                manager.load_extension(name)
        else:
            manager.load_extension(name)