def METHOD_NAME(self, qapp, mocker):
    """
    Test that the custom exit method is called on shutdown
    """
    # Must mask sys.exit, otherwise the whole testing process stops.
    mocker.patch.object(sys, 'exit')
    # mocker.patch.object(QtWidgets.QMessageBox, 'question', return_value=QtWidgets.QMessageBox.Yes)
    mocker.patch.object(HidableDialog, 'exec', return_value=1)
    # Open, then close the main window
    screen_resolution = QtCore.QRect(0, 0, 640, 480)
    tmp_main = MainSasViewWindow(screen_resolution, None)
    tmp_main.close()
    # See that the MessageBox method got called
    assert HidableDialog.exec.called_once()