From 33d9b9f2a7dd801f3d5f3bcb57760b320a189f64 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Sat, 4 Jul 2026 19:55:37 -0400 Subject: [PATCH] test(layout): keep css contract failures focused on assertions (#5545) --- tests/test_issue5545_three_panel_layout.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_issue5545_three_panel_layout.py b/tests/test_issue5545_three_panel_layout.py index 50811001..f63a66ec 100644 --- a/tests/test_issue5545_three_panel_layout.py +++ b/tests/test_issue5545_three_panel_layout.py @@ -31,9 +31,14 @@ def _media_blocks(kind): return blocks +def _normalize_css(css): + return re.sub(r"\s+", "", css) + + def _media_block(kind, width_px, needle): + normalized_needle = _normalize_css(needle) for current_width, block in _media_blocks(kind): - if current_width == width_px and needle in block: + if current_width == width_px and normalized_needle in _normalize_css(block): return block raise AssertionError(f"Missing @media({kind}:{width_px}px) block containing {needle!r}")