Skip to content

Commit 73d3f9f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c96bd89 commit 73d3f9f

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/attr/_make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,7 @@ def _default_init_alias_for(name: str) -> str:
24292429
return name.lstrip("_")
24302430

24312431

2432-
def _validate_init_aliases(attrs: tuple["Attribute", ...]) -> None:
2432+
def _validate_init_aliases(attrs: tuple[Attribute, ...]) -> None:
24332433
"""
24342434
Ensure init aliases are valid Python parameter names.
24352435
"""
@@ -3447,4 +3447,4 @@ def pipe_converter(val):
34473447

34483448
if return_instance:
34493449
return Converter(pipe_converter, takes_self=True, takes_field=True)
3450-
return pipe_converter
3450+
return pipe_converter

tests/test_make.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,9 +2455,8 @@ def test_invalid_alias(self, alias):
24552455
__init__ source code.
24562456
"""
24572457

2458-
with pytest.raises(
2459-
TypeError, match="Invalid initialization alias"
2460-
):
2458+
with pytest.raises(TypeError, match="Invalid initialization alias"):
2459+
24612460
@attrs.define
24622461
class C:
24632462
x: int = attrs.field(alias=alias)
@@ -2470,9 +2469,7 @@ def test_invalid_alias_not_executed(self, monkeypatch):
24702469
marker = "_attrs_alias_executed"
24712470
monkeypatch.delattr("builtins." + marker, raising=False)
24722471

2473-
with pytest.raises(
2474-
TypeError, match="Invalid initialization alias"
2475-
):
2472+
with pytest.raises(TypeError, match="Invalid initialization alias"):
24762473
attr.make_class(
24772474
"C",
24782475
{
@@ -3251,4 +3248,4 @@ def test_make_class(self):
32513248
assert () == C1.__match_args__
32523249

32533250
C1 = make_class("C1", {"a": attr.ib(kw_only=True), "b": attr.ib()})
3254-
assert ("b",) == C1.__match_args__
3251+
assert ("b",) == C1.__match_args__

0 commit comments

Comments
 (0)