From 095b122a68ef3bc3585b7cf64f05b79083247c99 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 26 Sep 2024 13:46:51 +0100 Subject: [PATCH 1/3] FIx incorrect import which was causing a segmentation fault --- glue_qt/conftest.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/glue_qt/conftest.py b/glue_qt/conftest.py index 6066fce0..d28f7cf2 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.utils import app + app.qapp = None if OBJGRAPH_INSTALLED and not ON_APPVEYOR: From 06669f78df0742cbd3c5f03365fbfbcc3d8e4300 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 26 Sep 2024 13:48:16 +0100 Subject: [PATCH 2/3] Unpin pytest --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From d425d67f74e5b552cbdf733830870fa468cd7d45 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 26 Sep 2024 13:48:56 +0100 Subject: [PATCH 3/3] Fix import --- glue_qt/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glue_qt/conftest.py b/glue_qt/conftest.py index d28f7cf2..a631af6a 100644 --- a/glue_qt/conftest.py +++ b/glue_qt/conftest.py @@ -83,7 +83,7 @@ def pytest_unconfigure(config): config.CFG_DIR = CFG_DIR_ORIG # Remove reference to QApplication to prevent segmentation fault on PySide - from glue.utils import app + from glue_qt.utils import app app.qapp = None if OBJGRAPH_INSTALLED and not ON_APPVEYOR: