From 93c427584875a2dec1819324dda75bca65a43974 Mon Sep 17 00:00:00 2001 From: MinaSaad1 Date: Tue, 7 Apr 2026 17:17:13 +0200 Subject: [PATCH] fix: wrap long lines in tests to pass ruff E501 (>100 chars) --- tests/test_report_backend.py | 3 ++- tests/test_visual_backend.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_report_backend.py b/tests/test_report_backend.py index 807da7f..771d913 100644 --- a/tests/test_report_backend.py +++ b/tests/test_report_backend.py @@ -1017,7 +1017,8 @@ def test_page_set_background_writes_color(sample_report: Path) -> None: def test_page_set_background_custom_transparency(sample_report: Path) -> None: result = page_set_background(sample_report, "page1", "#0E1117", transparency=50) assert result["transparency"] == 50 - props = _read(sample_report / "pages" / "page1" / "page.json")["objects"]["background"][0]["properties"] + page_data = _read(sample_report / "pages" / "page1" / "page.json") + props = page_data["objects"]["background"][0]["properties"] assert props["transparency"]["expr"]["Literal"]["Value"] == "50D" diff --git a/tests/test_visual_backend.py b/tests/test_visual_backend.py index 89a91cf..b831513 100644 --- a/tests/test_visual_backend.py +++ b/tests/test_visual_backend.py @@ -233,8 +233,8 @@ def test_visual_add_no_empty_objects(report_with_page: Path) -> None: visual_add(report_with_page, "test_page", "bar_chart", name="clean_bar") vfile = report_with_page / "pages" / "test_page" / "visuals" / "clean_bar" / "visual.json" data = json.loads(vfile.read_text(encoding="utf-8")) - assert "objects" not in data.get("visual", {}), \ - "visual.json must not contain empty 'objects: {}' -- Desktop strips it and schema validators reject it" + # Desktop strips empty objects and schema validators reject it + assert "objects" not in data.get("visual", {}) # ---------------------------------------------------------------------------