def test_preferencesdialog(): app = QtWidgets.QApplication(sys.argv) d = PreferencesDialog() d.show() app.exec_()