"""Explicit application shutdown: closing the feature panel only hides it.""" import pytest from PySide6.QtWidgets import QApplication from dx_productivity.ui.main_window import MainWindow @pytest.fixture(autouse=True) def shutdown_productivity_windows(qtbot): yield for window in QApplication.topLevelWidgets(): if isinstance(window, MainWindow): startup = getattr(window, 'startup_controller', None) if startup is not None and startup.is_running(): qtbot.waitUntil(lambda: not startup.is_running(), timeout=10000) window.request_exit()