def METHOD_NAME(progressbar):
    "A progressbar can switch between determinate and indeterminate"
    # Set initial max and value
    progressbar.max = 10
    progressbar.value = 5
    # State of progress bar is determinate
    assert progressbar.is_determinate
    assert progressbar.value == pytest.approx(5.0)
    # Make the progress bar indeterminate
    progressbar.max = None
    # State of progress bar is indeterminate
    assert not progressbar.is_determinate
    assert progressbar.value is None
    # Switch back to determinate
    progressbar.max = 15
    # State of progress bar is determinate
    assert progressbar.is_determinate
    assert progressbar.value == pytest.approx(5.0)