Skip to content

Commit

Permalink
Merge pull request #25 from astrofrog/fix-import-and-segfault
Browse files Browse the repository at this point in the history
Fix import and segfault in test suite
  • Loading branch information
astrofrog authored Sep 26, 2024
2 parents 414c47e + d425d67 commit 8a1d6ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
19 changes: 4 additions & 15 deletions glue_qt/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ docs =
qt =
PyQt5>=5.14
test =
pytest<8.3.3
pytest
pytest-cov
pytest-faulthandler
pytest-flake8
Expand Down

0 comments on commit 8a1d6ab

Please sign in to comment.