Skip to content

Commit 4279254

Browse files
committed
Remove test teardown hook for closing dialogs in conftest.py
Thanks to a fix in guidata v3.12 PlotPyStack/guidata@ae6ea2e
1 parent e144811 commit 4279254

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

plotpy/tests/conftest.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import scipy
1414
import tifffile
1515
from guidata.env import execenv
16-
from qtpy import QtCore as QC
17-
from qtpy import QtWidgets as QW
1816

1917
import plotpy
2018

@@ -51,20 +49,6 @@ def pytest_runtest_setup(item):
5149
pytest.skip("Skipped in offscreen mode (requires display)")
5250

5351

54-
@pytest.hookimpl(tryfirst=True)
55-
def pytest_runtest_teardown(item, nextitem): # pylint: disable=unused-argument
56-
"""Run teardown after each test."""
57-
# This is necessary to close any open dialogs after each test because the
58-
# mechanism used to close them automatically in the test suite
59-
# (i.e., `exec_dialog`) does not work with some PyQt versions.
60-
QC.QCoreApplication.processEvents()
61-
qapp: QW.QApplication = QW.QApplication.instance()
62-
if qapp is not None:
63-
for widget in qapp.topLevelWidgets():
64-
if isinstance(widget, QW.QDialog) and widget.isVisible():
65-
widget.reject()
66-
67-
6852
@pytest.fixture(scope="session", autouse=True)
6953
def disable_gc_for_tests():
7054
"""Disable garbage collection for all tests in the session."""

0 commit comments

Comments
 (0)