Merge branch 'fix_tests' into 'master'

Fix tests (broken on newer versions of pytest-qt)

See merge request openlp/openlp!332
This commit is contained in:
Raoul Snyman 2021-06-18 05:19:44 +00:00
commit 88f7a805f8

View File

@ -43,6 +43,11 @@ from openlp.core.common.settings import Settings
@pytest.fixture
def qapp(qtbot):
"""An instance of QApplication"""
# Newer versions of pytest-qt have QApplication in the widgets module.
# Catch attribute error if the widgets module is missing and instantiate QApplication the old way.
try:
qt_api.QtWidgets.QApplication.instance()
except AttributeError:
qt_api.QApplication.instance()
app = OpenLP()
yield app