def qapp(): """ fixture that instantiates the QApplication instance that will be used by the tests. """ app = qt_api.QApplication.instance() if app is None: global _qapp_instance _qapp_instance = qt_api.QApplication([]) yield _qapp_instance else: yield app # pragma: no cover
def qapp(qapp_args): """ Fixture that instantiates the QApplication instance that will be used by the tests. You can use the ``qapp`` fixture in tests which require a ``QApplication`` to run, but where you don't need full ``qtbot`` functionality. """ app = qt_api.QApplication.instance() if app is None: global _qapp_instance _qapp_instance = qt_api.QApplication(qapp_args) yield _qapp_instance else: yield app # pragma: no cover
def qapp(qapp_args, pytestconfig): """ Fixture that instantiates the QApplication instance that will be used by the tests. You can use the ``qapp`` fixture in tests which require a ``QApplication`` to run, but where you don't need full ``qtbot`` functionality. """ app = qt_api.QApplication.instance() if app is None: global _qapp_instance _qapp_instance = qt_api.QApplication(qapp_args) name = pytestconfig.getini("qt_qapp_name") _qapp_instance.setApplicationName(name) return _qapp_instance else: return app # pragma: no cover