async def METHOD_NAME(widget, probe):
    "Changing between determinate and indeterminate starts and stops the animation"
    # Start the animation
    widget.start()
    await probe.redraw("Progress bar animation should be started")
    # Widget is running, but there's no animation
    assert widget.is_running
    assert not probe.is_animating_indeterminate
    # Switch to indeterminate
    widget.max = None
    await probe.redraw("Progress bar should be switched to indeterminate")
    # Widget is still running, animation has started
    assert widget.is_running
    assert probe.is_animating_indeterminate
    # Switch back to determinate
    widget.max = 50
    await probe.redraw("Progress bar should be switched to determinate")
    # Widget is still running, animation has stopped
    assert widget.is_running
    assert not probe.is_animating_indeterminate
    # The determinate value of the progressbar has been lost.
    assert widget.value == pytest.approx(0.0)