0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 11:41:49 +02:00

fix: test_config_dialog.py - QApplication removed

This commit is contained in:
wyzula-jan
2023-10-30 10:41:52 +01:00
committed by wyzula_j
parent 1333e6cbca
commit 1cdd760e40

View File

@ -24,20 +24,20 @@ config_device_no_entry = load_config(
config_scan = load_config(os.path.join(current_path, "test_configs/config_scan.yaml"))
@pytest.fixture(scope="module") # TODO is this needed?
def app():
app = QApplication([])
yield app
@pytest.fixture
def qtbot(app, qtbot): # TODO is this needed?
"""A qtbot fixture to ensure that widgets are closed after being used."""
qtbot.old_widgets = set(app.topLevelWidgets())
yield qtbot
new_widgets = set(app.topLevelWidgets()) - qtbot.old_widgets
for widget in new_widgets:
widget.close()
# @pytest.fixture(scope="module") # TODO is this needed?
# def app():
# app = QApplication([])
# yield app
#
#
# @pytest.fixture
# def qtbot(app, qtbot): # TODO is this needed?
# """A qtbot fixture to ensure that widgets are closed after being used."""
# qtbot.old_widgets = set(app.topLevelWidgets())
# yield qtbot
# new_widgets = set(app.topLevelWidgets()) - qtbot.old_widgets
# for widget in new_widgets:
# widget.close()
def setup_config_dialog(qtbot):