import os import pytest # Окна в тестах не показываем os.environ.setdefault("QT_QPA_PLATFORM", "offscreen") from collections.abc import Iterator # noqa: E402 from PySide6.QtWidgets import QApplication # noqa: E402 from tests.fake_llm import FakeLLMServer # noqa: E402 @pytest.fixture(scope="session") def qapp() -> QApplication: return QApplication.instance() or QApplication([]) @pytest.fixture def fake_llm() -> Iterator[FakeLLMServer]: server = FakeLLMServer() yield server server.close()