def METHOD_NAME(caplog, qtbot, py_proc, runner):
    """Delete a temporary file from the script so cleanup fails."""
    cmd, args = py_proc(r"""
        import os
        os.remove(os.environ['QUTE_HTML'])
    """)
    with caplog.at_level(logging.ERROR):
        with qtbot.wait_signal(runner.finished, timeout=10000):
            runner.prepare_run(cmd, *args)
            runner.store_text('')
            runner.store_html('')
    assert len(caplog.records) == 1
    expected = "Failed to delete tempfile"
    assert caplog.messages[0].startswith(expected)