Skip to content

Commit 902ebb7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0d20013 commit 902ebb7

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

changelog.d/1424.change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
`attrs.make_class()` now works when its `attrs` argument is a dict of existing `attrs.Attribute` instances (e.g. from `attrs.fields(cls)`), not just fresh `attr.ib()` / `attrs.field()` call
1+
`attrs.make_class()` now works when its `attrs` argument is a dict of existing `attrs.Attribute` instances (e.g. from `attrs.fields(cls)`), not just fresh `attr.ib()` / `attrs.field()` call

src/attr/_make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def _rewrite_closure_cells(item, old_cls, new_cls):
600600
for cell in closure_cells:
601601
try:
602602
contents = cell.cell_contents
603-
except ValueError: # noqa: PERF203
603+
except ValueError:
604604
# ValueError: Cell is empty
605605
continue
606606

tests/test_converters.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ def test_falsy(self):
365365
assert not to_bool("no")
366366
assert not to_bool("off")
367367

368-
@pytest.mark.parametrize("value", [b"true", b"t", b"yes", b"y", b"on", b"1"])
368+
@pytest.mark.parametrize(
369+
"value", [b"true", b"t", b"yes", b"y", b"on", b"1"]
370+
)
369371
def test_truthy_bytes(self, value):
370372
"""
371373
Bytes values that decode to a truthy keyword match the str truthy path.
@@ -386,8 +388,10 @@ def test_bytes_are_lowercased(self, value):
386388
"""
387389
Bytes inputs follow the same case-insensitive lookup as str inputs.
388390
"""
389-
assert to_bool(value) is bool(value.decode("ascii").lower() in
390-
{"true", "t", "yes", "y", "on", "1"})
391+
assert to_bool(value) is bool(
392+
value.decode("ascii").lower()
393+
in {"true", "t", "yes", "y", "on", "1"}
394+
)
391395

392396
def test_bytearray_truthy(self):
393397
"""

tests/test_slots.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,11 @@ def test_decorated_method_with_super(self, slots):
512512
The parametrized ``slots`` fixture covers both the slots-on and
513513
slots-off paths; the bug is slots-specific.
514514
"""
515+
515516
def trace(method):
516517
def wrapper(self, *args, **kwargs):
517518
return method(self, *args, **kwargs)
519+
518520
return wrapper
519521

520522
@attr.s(slots=slots)
@@ -537,6 +539,7 @@ def f(self):
537539
def returns_class(method):
538540
def wrapper(self, *args, **kwargs):
539541
return method(self, *args, **kwargs)
542+
540543
return wrapper
541544

542545
@attr.s(slots=slots)

0 commit comments

Comments
 (0)