diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0bbfd5..50fa7f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.4.0" + rev: "v6.0.0" hooks: - id: check-added-large-files - id: check-case-conflict @@ -15,19 +15,19 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.9.7" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.13.3" hooks: - id: ruff args: [--fix] - - repo: https://github.com/psf/black - rev: "23.1.0" + - repo: https://github.com/psf/black-pre-commit-mirror + rev: "25.9.0" hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.15.0" + rev: "v1.18.2" hooks: - id: mypy exclude: (setup.py|^tests|conftest.py) @@ -41,12 +41,12 @@ repos: - pytest - repo: https://github.com/shellcheck-py/shellcheck-py - rev: "v0.9.0.2" + rev: "v0.11.0.1" hooks: - id: shellcheck - repo: https://github.com/codespell-project/codespell - rev: "v2.2.4" + rev: "v2.4.1" hooks: - id: codespell args: ["-L", "te,slowy,aray,ba,nd,classs,crate,feld,lits"] diff --git a/pytest_pyodide/decorator.py b/pytest_pyodide/decorator.py index 777ee68..3acd087 100644 --- a/pytest_pyodide/decorator.py +++ b/pytest_pyodide/decorator.py @@ -24,22 +24,17 @@ class SeleniumType(Protocol): JavascriptException: type browser: str - def load_package(self, pkgs: str | list[str]): - ... + def load_package(self, pkgs: str | list[str]): ... - def run_async(self, code: str): - ... + def run_async(self, code: str): ... - def run_js(self, code: str): - ... + def run_js(self, code: str): ... class _ReadableFileobj(Protocol): - def read(self, __n: int) -> bytes: - ... + def read(self, __n: int) -> bytes: ... - def readline(self) -> bytes: - ... + def readline(self) -> bytes: ... class Unpickler(pickle.Unpickler): diff --git a/pytest_pyodide/fixture.py b/pytest_pyodide/fixture.py index 65ea6f7..7bc92b8 100644 --- a/pytest_pyodide/fixture.py +++ b/pytest_pyodide/fixture.py @@ -275,10 +275,11 @@ def selenium_context_manager(selenium_module_scope): @pytest.fixture def selenium(request, selenium_module_scope): - with selenium_context_manager( - selenium_module_scope - ) as selenium, set_webdriver_script_timeout( - selenium, script_timeout=parse_driver_timeout(request.node) + with ( + selenium_context_manager(selenium_module_scope) as selenium, + set_webdriver_script_timeout( + selenium, script_timeout=parse_driver_timeout(request.node) + ), ): yield selenium @@ -295,10 +296,13 @@ def selenium_jspi_inner(request, runtime, web_server_main, playwright_browsers): pytest.skip(f"jspi not supported in {runtime}") if request.config.option.runner.lower() == "playwright": pytest.skip("jspi not supported with playwright") - with selenium_common( - request, runtime, web_server_main, browsers=playwright_browsers, jspi=True - ) as selenium, set_webdriver_script_timeout( - selenium, script_timeout=parse_driver_timeout(request.node) + with ( + selenium_common( + request, runtime, web_server_main, browsers=playwright_browsers, jspi=True + ) as selenium, + set_webdriver_script_timeout( + selenium, script_timeout=parse_driver_timeout(request.node) + ), ): yield selenium