Skip to content

Commit d64e368

Browse files
eschuthoclaude
andcommitted
chore(reports): lint fixups after rebase onto master
take_tiled_screenshot crossed ruff's C901 complexity threshold (11 > 10) once the budget logic merged with the positive readiness check and fail-loud flag from #42119 -- suppress like webdriver.py's get_screenshot does. Plus ruff-format on the rebased test file. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 98e3f28 commit d64e368

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

superset/utils/screenshot_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def combine_screenshot_tiles(
268268
return screenshot_tiles[0]
269269

270270

271-
def take_tiled_screenshot(
271+
def take_tiled_screenshot( # noqa: C901
272272
page: "Page",
273273
element_name: str,
274274
tile_height: int,

tests/unit_tests/utils/test_screenshot_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,8 @@ def test_budget_exhausted_raises_and_stops_capturing(self, mock_page, monkeypatc
648648
clock = self._FakeClock()
649649
# Tile 0's readiness wait consumes the whole budget; tile 1's budget
650650
# check then sees remaining <= 0 and raises before capturing.
651-
mock_page.wait_for_function.side_effect = (
652-
lambda *args, **kwargs: setattr(clock, "now", 1000.0)
651+
mock_page.wait_for_function.side_effect = lambda *args, **kwargs: setattr(
652+
clock, "now", 1000.0
653653
)
654654

655655
with patch("superset.utils.screenshot_utils.time.monotonic", new=clock):
@@ -695,8 +695,8 @@ def test_budget_exhausted_warning_includes_log_context(
695695
clock = self._FakeClock()
696696
# Tile 0's readiness wait consumes the whole budget; tile 1's budget
697697
# check then sees remaining <= 0 and raises.
698-
mock_page.wait_for_function.side_effect = (
699-
lambda *args, **kwargs: setattr(clock, "now", 1000.0)
698+
mock_page.wait_for_function.side_effect = lambda *args, **kwargs: setattr(
699+
clock, "now", 1000.0
700700
)
701701
with patch("superset.utils.screenshot_utils.time.monotonic", new=clock):
702702
with patch("superset.utils.screenshot_utils.combine_screenshot_tiles"):

0 commit comments

Comments
 (0)