From 40b73f2fb5000557c39221c5313f78d6977fd473 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:42:27 -0800 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#4547) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.1) * Fix wrapper's return types to be String or Text IO --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cooper Ry Lees --- .pre-commit-config.yaml | 2 +- tests/test_black.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c38354437e..2f1bae939aa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: exclude: ^src/blib2to3/ - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.1 hooks: - id: mypy exclude: ^(docs/conf.py|scripts/generate_schema.py)$ diff --git a/tests/test_black.py b/tests/test_black.py index 84061f10cdf..98d8ff886d7 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1355,8 +1355,10 @@ def test_reformat_one_with_stdin_empty(self) -> None: def _new_wrapper( output: io.StringIO, io_TextIOWrapper: type[io.TextIOWrapper] - ) -> Callable[[Any, Any], io.TextIOWrapper]: - def get_output(*args: Any, **kwargs: Any) -> io.TextIOWrapper: + ) -> Callable[[Any, Any], Union[io.StringIO, io.TextIOWrapper]]: + def get_output( + *args: Any, **kwargs: Any + ) -> Union[io.StringIO, io.TextIOWrapper]: if args == (sys.stdout.buffer,): # It's `format_stdin_to_stdout()` calling `io.TextIOWrapper()`, # return our mock object.