def METHOD_NAME():
    def resolve_later() -> int:
        sleep(0.1)
        return 42
    cancel_called = False
    def on_cancel():
        nonlocal cancel_called
        cancel_called = True
    result: Result[int] = Result(resolve_later, on_cancel=on_cancel)
    result.cancel()
    assert cancel_called
    assert not result.data_is_available
    with pytest.raises(Exception, match=""):
        result.result()