Skip to content

Commit f123f8f

Browse files
authored
chore: bump linters (pre-commit) (#1624)
1 parent 9b2d682 commit f123f8f

22 files changed

+45
-41
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ repos:
1515
- id: check-executables-have-shebangs
1616
- id: check-merge-conflict
1717
- repo: https://github.com/psf/black
18-
rev: 22.6.0
18+
rev: 22.10.0
1919
hooks:
2020
- id: black
2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v0.971
22+
rev: v0.982
2323
hooks:
2424
- id: mypy
25-
additional_dependencies: [types-pyOpenSSL==21.0.3]
25+
additional_dependencies: [types-pyOpenSSL==22.1.0.1]
2626
exclude: examples/
2727
- repo: https://github.com/pycqa/flake8
2828
rev: 5.0.4
@@ -40,4 +40,4 @@ repos:
4040
language: node
4141
pass_filenames: false
4242
types: [python]
43-
additional_dependencies: ["pyright@1.1.210"]
43+
additional_dependencies: ["pyright@1.1.278"]

playwright/_impl/__pyinstaller/hook-playwright.async_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from PyInstaller.utils.hooks import collect_data_files
15+
from PyInstaller.utils.hooks import collect_data_files # type: ignore
1616

1717
datas = collect_data_files("playwright")

playwright/_impl/__pyinstaller/hook-playwright.sync_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from PyInstaller.utils.hooks import collect_data_files
15+
from PyInstaller.utils.hooks import collect_data_files # type: ignore
1616

1717
datas = collect_data_files("playwright")

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ pythonVersion = "3.7"
3737
reportMissingImports = false
3838
reportTypedDictNotRequiredAccess = false
3939
reportCallInDefaultInitializer = true
40+
reportOptionalSubscript = false
41+
reportUnboundVariable = false
42+
strictParameterNoneValue = false

tests/async/test_browsercontext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ async def test_page_event_should_have_an_opener(context, server):
681681
page = await context.new_page()
682682
await page.goto(server.EMPTY_PAGE)
683683
async with context.expect_page() as page_info:
684-
await page.goto(server.PREFIX + "/popup/window-open.html"),
684+
await page.goto(server.PREFIX + "/popup/window-open.html")
685685
popup = await page_info.value
686686
assert popup.url == server.PREFIX + "/popup/popup.html"
687687
assert await popup.opener() == page

tests/async/test_console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def test_console_should_trigger_correct_log(page, server):
111111
async def test_console_should_have_location_for_console_api_calls(page, server):
112112
await page.goto(server.EMPTY_PAGE)
113113
async with page.expect_console_message() as message_info:
114-
await page.goto(server.PREFIX + "/consolelog.html"),
114+
await page.goto(server.PREFIX + "/consolelog.html")
115115
message = await message_info.value
116116
assert message.text == "yellow"
117117
assert message.type == "log"

tests/async/test_device_descriptors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ async def test_should_work(playwright, launch_arguments) -> None:
2121

2222
assert device_descriptor["viewport"]["height"] > 700
2323
assert device_descriptor["viewport"]["height"] < 800
24-
inner_height = await page.evaluate("window.innerHeight")
25-
inner_height > 700
26-
inner_height < 800
24+
inner_height = await page.evaluate("window.screen.availHeight")
25+
assert inner_height > 700
26+
assert inner_height < 800
2727

2828
assert device_descriptor["viewport"]["width"] > 400
2929
assert device_descriptor["viewport"]["width"] < 500
30-
inner_width = await page.evaluate("window.innerWidth")
31-
inner_width > 400
32-
inner_width < 500
30+
inner_width = await page.evaluate("window.screen.availWidth")
31+
assert inner_width > 400
32+
assert inner_width < 500
3333

3434
assert device_descriptor["has_touch"]
3535
assert device_descriptor["is_mobile"]

tests/async/test_geolocation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ async def test_watch_position_should_be_notified(page, server, context):
112112
await context.set_geolocation({"latitude": 40, "longitude": 50})
113113

114114
all_messages = "|".join(messages)
115-
"latitude=0 lng=10" in all_messages
116-
"latitude=20 lng=30" in all_messages
117-
"latitude=40 lng=50" in all_messages
115+
assert "lat=0 lng=10" in all_messages
116+
assert "lat=20 lng=30" in all_messages
117+
assert "lat=40 lng=50" in all_messages
118118

119119

120120
async def test_should_use_context_options_for_popup(page, context, server):

tests/async/test_interception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def test_page_route_should_work_when_POST_is_redirected_with_302(page, ser
103103
"""
104104
)
105105
async with page.expect_navigation():
106-
await page.eval_on_selector("form", "form => form.submit()"),
106+
await page.eval_on_selector("form", "form => form.submit()")
107107

108108

109109
# @see https://github.com/GoogleChrome/puppeteer/issues/3973

tests/async/test_locators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ async def test_locators_should_upload_a_file(page: Page, server: Server):
327327
async def test_locators_should_press(page: Page):
328328
await page.set_content("<input type='text' />")
329329
await page.locator("input").press("h")
330-
await page.eval_on_selector("input", "input => input.value") == "h"
330+
assert await page.eval_on_selector("input", "input => input.value") == "h"
331331

332332

333333
async def test_locators_should_scroll_into_view(page: Page, server: Server):
@@ -363,7 +363,7 @@ async def test_locators_should_select_textarea(
363363
async def test_locators_should_type(page: Page):
364364
await page.set_content("<input type='text' />")
365365
await page.locator("input").type("hello")
366-
await page.eval_on_selector("input", "input => input.value") == "hello"
366+
assert await page.eval_on_selector("input", "input => input.value") == "hello"
367367

368368

369369
async def test_locators_should_screenshot(

0 commit comments

Comments
 (0)