From a75eac264ecf1cc47864dcf1dfa58ce1a7499473 Mon Sep 17 00:00:00 2001 From: Dawn Date: Sat, 22 Aug 2026 03:09:05 +0200 Subject: [PATCH] test: sample padding pixel so movestate colors survive Linux fonts x=20 sits on a digit glyph with CI's Linux fonts, so the assert compared an antialiased glyph blend against the pure background. The padding area (border 1px + padding 6px) can never contain text on any font. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_0147jE48bQUTm9AqNQApT6b2 --- tests/unit/gui/test_motor_move_group.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/gui/test_motor_move_group.py b/tests/unit/gui/test_motor_move_group.py index 8f0653db..fac30cf6 100644 --- a/tests/unit/gui/test_motor_move_group.py +++ b/tests/unit/gui/test_motor_move_group.py @@ -120,8 +120,12 @@ def test_spin_move_state_colors_actually_render(qtbot): spin.show() def value_area_color(): + # Sample inside the left padding (1px border + 6px QSS padding), not + # the text area: glyph positions are font-dependent and on CI's Linux + # fonts x=20 lands on a digit of "12.40", returning an antialiased + # glyph/background blend instead of the plain background color. img = spin.grab().toImage() - return img.pixelColor(20, img.height() // 2) + return img.pixelColor(4, img.height() // 2) state.update_actual(12.0) neutral = value_area_color()