def METHOD_NAME(hook_decorator):
    entered = []
    @hook_decorator
    def my_hook(_):
        entered.append("yes")
    my_hook(None)
    assert entered == ["yes"]
    entered = []
    my_hook(build_hook_context())
    assert entered == ["yes"]
    entered = []
    my_hook(_=build_hook_context())
    assert entered == ["yes"]
    with pytest.raises(
        DagsterInvalidInvocationError,
        match="Decorated function expects one parameter, _, but 0 were provided.",
    ):
        my_hook()
    with pytest.raises(
        DagsterInvalidInvocationError, match="Could not find expected argument '_'."
    ):
        my_hook(foo=None)