Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade authored and Thiago Perrotta committed Oct 16, 2023
1 parent 93119d8 commit abe0a11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Apply all pre-commit hooks to all files:
# $ pre-commit run --all-files
default_stages: [pre-push]
default_stages: [pre-push, manual]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"eslint": "wireit",
"flake8": "flake8 examples/ tests/",
"format": "npm run pre-commit --",
"pre-commit": "pre-commit run --all-files",
"pre-commit": "pre-commit run --hook-stage manual --all-files",
"prepare": "wireit",
"prettier": "prettier --write .",
"rollup": "wireit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pytest
from anys import ANY_STR
from test_helpers import (assert_images_similar, execute_command, get_tree,
from test_helpers import (assert_images_similar, get_tree,
goto_url, read_JSON_message, send_JSON_command)


Expand Down Expand Up @@ -61,8 +61,7 @@ async def test_screenshot(websocket, context_id, png_filename):

resp = await read_JSON_message(websocket)
assert resp["result"] == {'data': ANY_STR}
with open(Path(__file__).parent.resolve() / png_filename,
'wb') as im:
with open(Path(__file__).parent.resolve() / png_filename, 'wb') as im:
im.write(base64.b64decode(resp["result"]["data"]))

assert_images_similar(resp["result"]["data"], png_base64)
Expand Down Expand Up @@ -156,8 +155,12 @@ async def test_screenshot_oopif(websocket, context_id, html, iframe):


@pytest.mark.asyncio
async def test_screenshot_document(websocket, context_id, query_selector, html):
await goto_url(websocket, context_id, html('<div style="width: 100px; height: 100px; background: red"></div>'))
async def test_screenshot_document(websocket, context_id, query_selector,
html):
await goto_url(
websocket, context_id,
html('<div style="width: 100px; height: 100px; background: red"></div>'
))

# Set a fixed viewport to make the test deterministic.
await send_JSON_command(
Expand Down

0 comments on commit abe0a11

Please sign in to comment.