Skip to content

Commit 4241fd7

Browse files
fixing copilot reviews
1 parent a684f63 commit 4241fd7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

percy/snapshot.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def fetch_percy_dom():
8686
response.raise_for_status()
8787
return response.text
8888

89-
# pylint: disable=too-many-arguments, too-many-branches, too-many-locals
89+
# pylint: disable=too-many-arguments, too-many-branches, too-many-locals, too-many-positional-arguments
9090
def create_region(
9191
boundingBox=None,
9292
elementXpath=None,
@@ -359,14 +359,14 @@ def capture_responsive_dom(driver, cookies, config, percy_dom_script=None, **kwa
359359
min_height = kwargs.get('minHeight') or config.get('snapshot', {}).get('minHeight')
360360
if min_height:
361361
try:
362-
min_height_int = int(min_height)
363-
except (TypeError, ValueError):
362+
min_height = int(min_height)
363+
except (TypeError, ValueError):
364364
log(
365365
f'Invalid minHeight value {min_height!r}; expected integer, '
366366
'using current window height instead.',
367367
'debug',
368368
)
369-
else:
369+
else:
370370
target_height = driver.execute_script(
371371
f"return window.outerHeight - window.innerHeight + {min_height}")
372372
log(
@@ -424,8 +424,12 @@ def percy_snapshot(driver, name, **kwargs):
424424
# Serialize and capture the DOM
425425
if is_responsive_snapshot_capture(data['config'], **kwargs):
426426
dom_snapshot = capture_responsive_dom(
427-
driver, data['widths'], cookies, data['config'],
428-
percy_dom_script=percy_dom_script, **kwargs)
427+
driver=driver,
428+
cookies=cookies,
429+
config=data['config'],
430+
percy_dom_script=percy_dom_script,
431+
**kwargs,
432+
)
429433
else:
430434
dom_snapshot = get_serialized_dom(
431435
driver, cookies, percy_dom_script=percy_dom_script, **kwargs)

0 commit comments

Comments
 (0)