Skip to content

Commit a098295

Browse files
[pre-commit.ci] pre-commit autoupdate (#84)
1 parent 61e4c3c commit a098295

File tree

5 files changed

+28
-33
lines changed

5 files changed

+28
-33
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default_language_version:
22
python: "3.10"
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: "v4.4.0"
5+
rev: "v5.0.0"
66
hooks:
77
- id: check-added-large-files
88
- id: check-case-conflict
@@ -15,19 +15,19 @@ repos:
1515
- id: mixed-line-ending
1616
- id: trailing-whitespace
1717

18-
- repo: https://github.com/charliermarsh/ruff-pre-commit
19-
rev: "v0.0.254"
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: "v0.6.9"
2020
hooks:
2121
- id: ruff
2222
args: [--fix]
2323

2424
- repo: https://github.com/psf/black
25-
rev: "23.1.0"
25+
rev: "24.10.0"
2626
hooks:
2727
- id: black
2828

2929
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: "v1.1.1"
30+
rev: "v1.11.2"
3131
hooks:
3232
- id: mypy
3333
exclude: (setup.py|^tests|conftest.py)
@@ -41,12 +41,12 @@ repos:
4141
- pytest
4242

4343
- repo: https://github.com/shellcheck-py/shellcheck-py
44-
rev: "v0.9.0.2"
44+
rev: "v0.10.0.1"
4545
hooks:
4646
- id: shellcheck
4747

4848
- repo: https://github.com/codespell-project/codespell
49-
rev: "v2.2.4"
49+
rev: "v2.3.0"
5050
hooks:
5151
- id: codespell
5252
args: ["-L", "te,slowy,aray,ba,nd,classs,crate,feld,lits"]

pytest_pyodide/decorator.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,17 @@ class SeleniumType(Protocol):
2626
JavascriptException: type
2727
browser: str
2828

29-
def load_package(self, pkgs: str | list[str]):
30-
...
29+
def load_package(self, pkgs: str | list[str]): ...
3130

32-
def run_async(self, code: str):
33-
...
31+
def run_async(self, code: str): ...
3432

35-
def run_js(self, code: str):
36-
...
33+
def run_js(self, code: str): ...
3734

3835

3936
class _ReadableFileobj(Protocol):
40-
def read(self, __n: int) -> bytes:
41-
...
37+
def read(self, __n: int) -> bytes: ...
4238

43-
def readline(self) -> bytes:
44-
...
39+
def readline(self) -> bytes: ...
4540

4641

4742
class Unpickler(pickle.Unpickler):

pytest_pyodide/fixture.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,11 @@ def selenium_context_manager(selenium_module_scope):
274274

275275
@pytest.fixture
276276
def selenium(request, selenium_module_scope):
277-
with selenium_context_manager(
278-
selenium_module_scope
279-
) as selenium, set_webdriver_script_timeout(
280-
selenium, script_timeout=parse_driver_timeout(request.node)
277+
with (
278+
selenium_context_manager(selenium_module_scope) as selenium,
279+
set_webdriver_script_timeout(
280+
selenium, script_timeout=parse_driver_timeout(request.node)
281+
),
281282
):
282283
yield selenium
283284

@@ -294,10 +295,13 @@ def selenium_jspi_inner(request, runtime, web_server_main, playwright_browsers):
294295
pytest.skip(f"jspi not supported in {runtime}")
295296
if request.config.option.runner.lower() == "playwright":
296297
pytest.skip("jspi not supported with playwright")
297-
with selenium_common(
298-
request, runtime, web_server_main, browsers=playwright_browsers, jspi=True
299-
) as selenium, set_webdriver_script_timeout(
300-
selenium, script_timeout=parse_driver_timeout(request.node)
298+
with (
299+
selenium_common(
300+
request, runtime, web_server_main, browsers=playwright_browsers, jspi=True
301+
) as selenium,
302+
set_webdriver_script_timeout(
303+
selenium, script_timeout=parse_driver_timeout(request.node)
304+
),
301305
):
302306
yield selenium
303307

pytest_pyodide/runner.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,11 @@ def clean_logs(self):
596596

597597
def run_js_inner(self, code, check_code):
598598
check_code = ""
599-
wrapped = """
600-
let result = await (async () => {{ {} }})();
601-
{}
599+
wrapped = f"""
600+
let result = await (async () => {{ {code} }})();
601+
{check_code}
602602
return result;
603-
""".format(
604-
code,
605-
check_code,
606-
)
603+
"""
607604
from uuid import uuid4
608605

609606
cmd_id = str(uuid4())

tests/test_decorator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def assert_get_handle(selenium, d, key, value):
255255
@run_in_pyodide
256256
def returns_handle(selenium):
257257
import __main__
258-
259258
from pytest_pyodide.decorator import PyodideHandle
260259

261260
o = {"a": 6}

0 commit comments

Comments
 (0)