Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import and segfault in test suite #25

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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

Check warning on line 87 in glue_qt/conftest.py

View check run for this annotation

Codecov / codecov/patch

glue_qt/conftest.py#L86-L87

Added lines #L86 - L87 were not covered by tests

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
Loading