Skip to content

Commit 2e5e952

Browse files
committed
add test, fix add_notes->add_note, add _is_protocol
1 parent 373a860 commit 2e5e952

6 files changed

Lines changed: 18 additions & 5 deletions

File tree

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog
44

55
`CalVer, YY.month.patch <https://calver.org/>`_
66

7-
25.5.2
7+
FUTURE
88
======
99
- Add :ref:`ASYNC400 <async400>` except-star-invalid-attribute.
1010

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ adding the following to your ``.pre-commit-config.yaml``:
3333
minimum_pre_commit_version: '2.9.0'
3434
repos:
3535
- repo: https://github.com/python-trio/flake8-async
36-
rev: 25.5.2
36+
rev: 25.5.1
3737
hooks:
3838
- id: flake8-async
3939
# args: ["--enable=ASYNC100,ASYNC112", "--disable=", "--autofix=ASYNC"]

flake8_async/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
# CalVer: YY.month.patch, e.g. first release of July 2022 == "22.7.1"
41-
__version__ = "25.5.2"
41+
__version__ = "25.5.1"
4242

4343

4444
# taken from https://github.com/Zac-HD/shed

flake8_async/visitors/visitor4xx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
# from BaseException
2525
"args",
2626
"with_traceback",
27-
"add_notes",
27+
"add_note",
28+
# in the backport
29+
"_is_protocol",
2830
)
2931

3032

tests/eval_files/async400_py311.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# from BaseException
1616
e.args
1717
e.with_traceback
18-
e.add_notes
18+
e.add_note
1919

2020
# ignore anything that looks like a dunder
2121
e.__foo__

tests/test_flake8_async.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
from flake8_async import Plugin
2727
from flake8_async.base import Error, Statement
2828
from flake8_async.visitors import ERROR_CLASSES, ERROR_CLASSES_CST
29+
from flake8_async.visitors.visitor4xx import EXCGROUP_ATTRS
30+
31+
if sys.version_info < (3, 11):
32+
from exceptiongroup import ExceptionGroup
2933

3034
if TYPE_CHECKING:
3135
from collections.abc import Iterable, Sequence
@@ -846,6 +850,13 @@ async def foo():
846850
assert not errors, "# false alarm:\n" + function_str
847851

848852

853+
def test_async400_excgroup_attributes():
854+
for attr in dir(ExceptionGroup):
855+
if attr.startswith("__") and attr.endswith("__"):
856+
continue
857+
assert attr in EXCGROUP_ATTRS
858+
859+
849860
# from https://docs.python.org/3/library/itertools.html#itertools-recipes
850861
def consume(iterator: Iterable[Any]):
851862
deque(iterator, maxlen=0)

0 commit comments

Comments
 (0)