def METHOD_NAME(hook_decorator, is_event_list_hook):
    decorator = hook_decorator(required_resource_keys={"foo", "bar"})
    if is_event_list_hook:
        def my_hook_reqs_resources(context, _):  # type: ignore  # (test rename)
            assert context.resources.foo == "foo"
            assert context.resources.bar == "bar"
        hook = decorator(my_hook_reqs_resources)
    else:
        def my_hook_reqs_resources(context):  # type: ignore  # (test rename)
            assert context.resources.foo == "foo"
            assert context.resources.bar == "bar"
        hook = decorator(my_hook_reqs_resources)
    @resource
    def bar_resource(_):
        return "bar"
    if is_event_list_hook:
        hook(build_hook_context(resources={"foo": "foo", "bar": bar_resource}), None)
    else:
        hook(build_hook_context(resources={"foo": "foo", "bar": bar_resource}))
    with pytest.raises(
        DagsterInvalidDefinitionError,
        match="resource with key 'bar' required by hook 'my_hook_reqs_resources'  was not provided",
    ):
        if is_event_list_hook:
            hook(None, None)
        else:
            hook(None)