From 6b2daaa2e9c8c325bdcb0886fc90d2df198af405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= <31284574+kloczek@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:52:29 +0100 Subject: [PATCH] [pre-commit] Add pyupgrade back as a manual stage (#12418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Launchable with ``pre-commit run --hook-stage manual pyupgrade -a`` --------- Signed-off-by: Tomasz Kłoczko Co-authored-by: Pierre Sassoulas --- .pre-commit-config.yaml | 5 +++++ testing/test_unittest.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a9fde6a5..fb583b111 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,6 +43,11 @@ repos: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version additional_dependencies: ["tox>=4.9"] +- repo: https://github.com/asottile/pyupgrade + rev: v3.15.2 + hooks: + - id: pyupgrade + stages: [manual] - repo: local hooks: - id: pylint diff --git a/testing/test_unittest.py b/testing/test_unittest.py index c359715dc..9561cad5e 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -384,7 +384,7 @@ def test_testcase_adderrorandfailure_defers(pytester: Pytester, type: str) -> No @pytest.mark.parametrize("type", ["Error", "Failure"]) def test_testcase_custom_exception_info(pytester: Pytester, type: str) -> None: pytester.makepyfile( - """ + f""" from typing import Generic, TypeVar from unittest import TestCase import pytest, _pytest._code @@ -413,7 +413,7 @@ def test_testcase_custom_exception_info(pytester: Pytester, type: str) -> None: def test_hello(self): pass - """.format(**locals()) + """ ) result = pytester.runpytest() result.stdout.fnmatch_lines(