Change-detectors, tautologies, source-reading tests, redundant duplicates, mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane ledger (category + reason for every removal).
26 lines
567 B
Python
26 lines
567 B
Python
"""Tests for the GUI-surface ``open_preview`` tool."""
|
|
|
|
import json
|
|
|
|
import pytest
|
|
|
|
from tools import desktop_ui, open_preview_tool as op
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _reset_emitter():
|
|
"""Each test controls the emitter; never leak one across tests."""
|
|
desktop_ui.set_emitter(None)
|
|
yield
|
|
desktop_ui.set_emitter(None)
|
|
|
|
|
|
|
|
|
|
def test_emitter_failure_is_reported():
|
|
def _boom(*_a):
|
|
raise RuntimeError("no window")
|
|
|
|
desktop_ui.set_emitter(_boom)
|
|
assert "no window" in json.loads(op.open_preview_tool("https://x.example"))["error"]
|