from typing import Callable


def make_mock_handler() -> Callable:
    """Generates an async function that returns the number of times it was called."""
    tocks = 0

    async def mock_handler(*args) -> int:
        nonlocal tocks
        tocks += 1
        return tocks

    return mock_handler