Skip to content

Commit

Permalink
Properly close main window in fixture
Browse files Browse the repository at this point in the history
This mirrors the changes in PR spyder-ide/spyder#21353
  • Loading branch information
jitseniesen committed Apr 14, 2024
1 parent defdcbf commit 5326809
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spyder_unittest/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from qtpy import QtWebEngineWidgets # noqa

# Spyder imports
from spyder import dependencies
from spyder import version_info as spyder_version_info
from spyder.api.plugin_registration.registry import PLUGIN_REGISTRY
from spyder.app import start
Expand All @@ -41,16 +40,15 @@ def main_window(monkeypatch):
CONF.set('tours', 'show_tour_message', False)
QApplication.processEvents()

# Reset global state
dependencies.DEPENDENCIES = []
PLUGIN_REGISTRY.reset()

# Start the window
window = start.main()
QApplication.processEvents()

yield window

# Close main window
window.closing(close_immediately=True)
window.close()
CONF.reset_to_defaults(notification=False)
CONF.reset_manager()
PLUGIN_REGISTRY.reset()

0 comments on commit 5326809

Please sign in to comment.