def teardown(self):
    if self.window.chat_window:
        self.window.chat_window.hide()
    if self.window.conn:
        self.window.conn.disconnect()
    self.window.hide()
    QtWidgets.QApplication.processEvents()
    self.application.quit()
    QtWidgets.QApplication.processEvents()
    self.process.terminate()
def teardown(self):
    if self.window.chat_window:
        self.window.chat_window.hide()
    if self.window.conn:
        self.window.conn.disconnect()
    self.window.hide()
    QtWidgets.QApplication.processEvents()
    self.application.quit()
    QtWidgets.QApplication.processEvents()
    self.process.terminate()