diff --git a/glue_qt/conftest.py b/glue_qt/conftest.py index 6066fce0..a631af6a 100644 --- a/glue_qt/conftest.py +++ b/glue_qt/conftest.py @@ -66,14 +66,8 @@ def pytest_configure(config): config.CFG_DIR = tempfile.mkdtemp() # Start up QApplication, if the Qt code is present - try: - from glue.utils import get_qapp - except Exception: - # Note that we catch any exception, not just ImportError, because - # QtPy can raise a PythonQtError. - pass - else: - get_qapp() + from glue_qt.utils import get_qapp + get_qapp() # Force loading of plugins from glue.main import load_plugins @@ -89,13 +83,8 @@ def pytest_unconfigure(config): config.CFG_DIR = CFG_DIR_ORIG # Remove reference to QApplication to prevent segmentation fault on PySide - try: - from glue.utils import app - app.qapp = None - except Exception: # for when we run the tests without the qt directories - # Note that we catch any exception, not just ImportError, because - # QtPy can raise a PythonQtError. - pass + from glue_qt.utils import app + app.qapp = None if OBJGRAPH_INSTALLED and not ON_APPVEYOR: diff --git a/setup.cfg b/setup.cfg index 5b57e9a4..a14e6663 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,7 +64,7 @@ docs = qt = PyQt5>=5.14 test = - pytest<8.3.3 + pytest pytest-cov pytest-faulthandler pytest-flake8