def METHOD_NAME(cv, enabled):
    """
    Helper for tests to enable/disable long double support in CVode, leaving the setting as they found it.
    """
    if cv is None:
        # CVode not enabled, do nothing
        yield None
    else:
        old_setting = cv.use_long_double()
        cv.use_long_double(enabled)
        try:
            yield None
        finally:
            cv.use_long_double(old_setting)