Skip to content

Commit 8a1d6ab

Browse files
authored
Merge pull request #25 from astrofrog/fix-import-and-segfault
Fix import and segfault in test suite
2 parents 414c47e + d425d67 commit 8a1d6ab

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

glue_qt/conftest.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,8 @@ def pytest_configure(config):
6666
config.CFG_DIR = tempfile.mkdtemp()
6767

6868
# Start up QApplication, if the Qt code is present
69-
try:
70-
from glue.utils import get_qapp
71-
except Exception:
72-
# Note that we catch any exception, not just ImportError, because
73-
# QtPy can raise a PythonQtError.
74-
pass
75-
else:
76-
get_qapp()
69+
from glue_qt.utils import get_qapp
70+
get_qapp()
7771

7872
# Force loading of plugins
7973
from glue.main import load_plugins
@@ -89,13 +83,8 @@ def pytest_unconfigure(config):
8983
config.CFG_DIR = CFG_DIR_ORIG
9084

9185
# Remove reference to QApplication to prevent segmentation fault on PySide
92-
try:
93-
from glue.utils import app
94-
app.qapp = None
95-
except Exception: # for when we run the tests without the qt directories
96-
# Note that we catch any exception, not just ImportError, because
97-
# QtPy can raise a PythonQtError.
98-
pass
86+
from glue_qt.utils import app
87+
app.qapp = None
9988

10089
if OBJGRAPH_INSTALLED and not ON_APPVEYOR:
10190

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ docs =
6464
qt =
6565
PyQt5>=5.14
6666
test =
67-
pytest<8.3.3
67+
pytest
6868
pytest-cov
6969
pytest-faulthandler
7070
pytest-flake8

0 commit comments

Comments
 (0)