Skip to content

Commit

Permalink
added teardown step to main_window fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyTeichman committed Dec 20, 2023
1 parent 884a35a commit 6015feb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ def main_window(qtbot, monkeypatch, use_temp_settings_file):
# sys.excepthook = window.excepthook
builtins.input = window.input
window._toggle_reporting(True)
return window
yield window

app = QtWidgets.QApplication.instance()
if app is not None:
for w in app.topLevelWidgets():
w.close()
n = len(app.topLevelWidgets())
print(f"{n} widgets in the balance.")



@pytest.fixture
Expand Down

0 comments on commit 6015feb

Please sign in to comment.