From 527d0439f8abba4e54a2855e3971f1a193a64c2d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:47:42 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v6.0.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.9.7 → v0.13.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.7...v0.13.3) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.1.0 → 25.9.0](https://github.com/psf/black-pre-commit-mirror/compare/23.1.0...25.9.0) - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.18.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.18.2) - [github.com/shellcheck-py/shellcheck-py: v0.9.0.2 → v0.11.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.9.0.2...v0.11.0.1) - [github.com/codespell-project/codespell: v2.2.4 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.2.4...v2.4.1) --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a0bbfd5b..50fa7f66 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"] From 95a37088b43970ec7f3bac2a18c2cbe86fc63d12 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:53:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pytest_pyodide/decorator.py | 15 +++++---------- pytest_pyodide/fixture.py | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/pytest_pyodide/decorator.py b/pytest_pyodide/decorator.py index 777ee682..3acd087f 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 65ea6f78..7bc92b83 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