diff --git a/agents/inbox/2026-08-21-A-antigravity-state-layer.md b/agents/inbox/2026-08-21-A-antigravity-state-layer.md index a6974b4..3f856c6 100644 --- a/agents/inbox/2026-08-21-A-antigravity-state-layer.md +++ b/agents/inbox/2026-08-21-A-antigravity-state-layer.md @@ -137,9 +137,11 @@ E assert None is not None Падают и по отдельности, и в полном прогоне — от порядка не зависят. То есть заявленная в `249a888` «immediate URL readiness» этими тестами не подтверждена. Разобраться: дефект в продукте или в тесте (например, мок `start_profile_oauth` не покрывает путь `_init_antigravity_oauth`). Пока не выяснено — считать функцию непроверенной. -### 3. Заглушка в `conftest.py` слишком широкая +### 3. Заглушка в `conftest.py` — ✅ уже исправлено ревьюером -`pytest_collection_modifyitems` пропускает тест, если в его имени встречается `ui`, `view` или `wizard`. Под это попадают и статические проверки, которым GUI не нужен, — из-за чего оба дефекта выше жили незамеченными. Заменить на явную маркировку (`@pytest.mark.gui`) либо на проверку реального импорта GUI-модулей. +Отбор шёл по имени теста (`ui`, `view`, `wizard`), из-за чего пропускались и статические проверки, не касающиеся GUI, — именно поэтому оба дефекта выше жили незамеченными. Теперь отбор только по маркеру `ui`; модули, импортирующие GUI, защищают себя `pytest.importorskip` на уровне модуля, и это требование закреплено `tests/test_import_invariants.py`. + +Действий не требуется — пункт оставлен для контекста. После правки headless-прогон даёт 156 passed вместо 152: четыре теста, которые раньше молча пропускались, теперь реально выполняются. **Критерий приёмки:** полный `pytest` зелёный **и** в окружении без UI-зависимостей, **и** в окружении с установленными `customtkinter`/`pillow`/`psutil`. Сейчас второй вариант даёт 4 падения. diff --git a/tests/conftest.py b/tests/conftest.py index c88c126..e149fc9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,16 +40,19 @@ def pytest_configure(config): def pytest_collection_modifyitems(config, items): - """Ensure tests requiring CustomTkinter gracefully skip if it cannot be loaded.""" - has_ctk = False - try: - import customtkinter as _ctk # noqa - has_ctk = True - except Exception: - has_ctk = False + """Skip tests explicitly marked as needing the Tk graphical stack. - if not has_ctk: + Selection is by the ``ui`` marker only. It used to also match any test whose + *name* contained "ui", "view" or "wizard", which silently skipped static + checks that never touch the toolkit — and hid real failures for weeks. + Modules that import the GUI stack guard themselves with + ``pytest.importorskip("customtkinter")`` at module scope; that guard is + enforced by tests/test_import_invariants.py. + """ + try: + import customtkinter # noqa: F401 + except Exception: skip_ui = pytest.mark.skip(reason="customtkinter is not installed in current environment") for item in items: - if "ui" in item.keywords or "view" in item.name.lower() or "wizard" in item.name.lower(): + if "ui" in item.keywords: item.add_marker(skip_ui)