def METHOD_NAME(
        caplog, value, precision, display_format, widget, expected):
    """
    Test that errors will be output into stderr.
    Parameters
    ----------
    caplog : fixture
        The fixture to capture log outputs
    value : int, float, hex, bin, str
        The incorrect data
    precision : int
        The numeric precision to consider during formatting
    display_format : int
        The format type for the provided value
    widget : PyDWidget
        The widget that will display the formatted value. This object can be None
    expected : str
        The expected formatted presentation of the provided value
    """
    parsed_value = parse_value_for_display(value, precision, display_format_type=display_format, widget=widget)
    if isinstance(value, np.ndarray):
        assert (np.array_equal(value, parsed_value))
    else:
        assert(parsed_value == value)
    # Make sure logging capture the error, and have the correct error message
    for record in caplog.records:
        assert record.levelno == logging.ERROR
    assert expected in caplog.text