From ba5ccd845a2261e538df651e3d528dc1bece094d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Aug 2022 11:38:07 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#4104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - [github.com/hadialqattan/pycln: v2.0.4 → v2.1.1](https://github.com/hadialqattan/pycln/compare/v2.0.4...v2.1.1) - [github.com/PyCQA/flake8: 4.0.1 → 5.0.2](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.2) * fix: minor touchups for flake8 Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 6 +++--- setup.cfg | 2 +- tests/test_exceptions.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2c098c5a..e41480d05 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: # Upgrade old Python syntax - repo: https://github.com/asottile/pyupgrade - rev: "v2.37.2" + rev: "v2.37.3" hooks: - id: pyupgrade args: [--py36-plus] @@ -71,7 +71,7 @@ repos: # Autoremoves unused imports - repo: https://github.com/hadialqattan/pycln - rev: "v2.0.4" + rev: "v2.1.1" hooks: - id: pycln stages: [manual] @@ -99,7 +99,7 @@ repos: # Flake8 also supports pre-commit natively (same author) - repo: https://github.com/PyCQA/flake8 - rev: "4.0.1" + rev: "5.0.2" hooks: - id: flake8 exclude: ^(docs/.*|tools/.*)$ diff --git a/setup.cfg b/setup.cfg index 36fbfed4f..9af50ea48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,5 +46,5 @@ zip_safe = False max-line-length = 120 show_source = True exclude = .git, __pycache__, build, dist, docs, tools, venv -extend-ignore = E203, E722, B950 +extend-ignore = E203, E722, B903, B950 extend-select = B9 diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 5e3beeedb..70b6ffea9 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -185,8 +185,8 @@ def test_custom(msg): with pytest.raises(m.MyException5) as excinfo: try: m.throws5() - except m.MyException5_1: - raise RuntimeError("Exception error: caught child from parent") + except m.MyException5_1 as err: + raise RuntimeError("Exception error: caught child from parent") from err assert msg(excinfo.value) == "this is a helper-defined translated exception"