Files
MeshTerm/tests/conftest.py
T
Jean-Pierre MartineauandClaude Fable 5 2c04fb5b96 Path line: path_text-parity factory, cursor-aware wrap, plain pin for tests
path_line() builds a PathLine from path_text's exact vocabulary (verified
character-for-character in tests), wrapped() carries the composer's
insertion cursor — riding the trailing arrow when its seam is the line
break — and conftest pins MESHTERM_POWERLINE=0 so screen assertions never
depend on which terminal runs the suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 20:30:50 -04:00

25 lines
866 B
Python

"""Shared fixtures: pin path rendering to plain arrows for every test.
The powerline verdict is environmental — the suite may run inside VS Code or Windows
Terminal (both chip-capable) or a bare CI shell (not) — and screen assertions must
not change with the developer's glass. ``MESHTERM_POWERLINE=0`` is the supported pin;
the cached verdict is cleared around each test so no ordering leaks it. Powerline-
specific tests pass explicit modes or monkeypatch the widget's own switch.
"""
from __future__ import annotations
from typing import Iterator
import pytest
from meshterm.ui.termfont import powerline_support
@pytest.fixture(autouse=True)
def _plain_path_rendering(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
monkeypatch.setenv("MESHTERM_POWERLINE", "0")
powerline_support.cache_clear()
yield
powerline_support.cache_clear()