'Test file handling when closing with an exit status != 0.'

def test_error(self, editor):

    editor.edit('')
    filename = editor._file.name
    assert os.path.exists(filename)
    editor._proc._proc.exitStatus = mock.Mock(return_value=QProcess.CrashExit)
    editor._proc.finished.emit(1, QProcess.NormalExit)
    assert os.path.exists(filename)
    os.remove(filename)
