def tearDownClass(cls): gc.collect() cls.app.setApplicationName(cls.__appname) cls.app.setOrganizationDomain(cls.__appdomain) cls.app = None super(QCoreAppTestCase, cls).tearDownClass() QStandardPaths.setTestModeEnabled(False)
def tearDownClass(cls): gc.collect() cls.app.setApplicationName(cls.__appname) cls.app.setOrganizationDomain(cls.__appdomain) cls.app.sendPostedEvents(None, 0) # Keep app instance alive between tests with PyQt5 5.14.0 and later if PYQT_VERSION <= 0x050e00: cls.app = None super(QCoreAppTestCase, cls).tearDownClass() QStandardPaths.setTestModeEnabled(False)
def setUpClass(cls): super(QCoreAppTestCase, cls).setUpClass() QStandardPaths.setTestModeEnabled(True) app = cls._AppClass.instance() if app is None: app = cls._AppClass([]) cls.app = app cls.__appname = cls.app.applicationName() cls.__appdomain = cls.app.organizationDomain() cls.app.setApplicationName("orangecanvas.testing") cls.app.setOrganizationDomain("biolab.si")
def setUp(self) -> None: super().setUp() QStandardPaths.setTestModeEnabled(True) QSettings.setDefaultFormat(QSettings.IniFormat)
def tearDown(self) -> None: QStandardPaths.setTestModeEnabled(False) QSettings.setDefaultFormat(QSettings.NativeFormat) super().tearDown()