Update Ruff

This commit is contained in:
Hynek Schlawack 2024-06-28 09:41:56 +02:00
parent e1b2c9491b
commit 11288d5709
No known key found for this signature in database
4 changed files with 16 additions and 13 deletions

View File

@ -9,7 +9,7 @@ repos:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.5.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

View File

@ -120,15 +120,15 @@ class TestAnnotations:
attr.resolve_types(C)
assert int == attr.fields(C).a.type
assert int is attr.fields(C).a.type
assert attr.Factory(list) == attr.fields(C).x.default
assert typing.List[int] == attr.fields(C).x.type
assert typing.List[int] is attr.fields(C).x.type
assert int == attr.fields(C).y.type
assert int is attr.fields(C).y.type
assert 2 == attr.fields(C).y.default
assert int == attr.fields(C).z.type
assert int is attr.fields(C).z.type
assert typing.Any == attr.fields(C).foo.type
@ -534,7 +534,7 @@ class TestAnnotations:
attr.resolve_types(C, globals)
assert attr.fields(C).x.type == Annotated[float, "test"]
assert Annotated[float, "test"] is attr.fields(C).x.type
@attr.define
class D:
@ -542,7 +542,7 @@ class TestAnnotations:
attr.resolve_types(D, globals, include_extras=False)
assert attr.fields(D).x.type == float
assert float is attr.fields(D).x.type
def test_resolve_types_auto_attrib(self, slots):
"""
@ -658,8 +658,8 @@ class TestAnnotations:
attr.resolve_types(A)
attr.resolve_types(B)
assert int == attr.fields(A).n.type
assert int == attr.fields(B).n.type
assert int is attr.fields(A).n.type
assert int is attr.fields(B).n.type
def test_resolve_twice(self):
"""
@ -672,9 +672,12 @@ class TestAnnotations:
n: "int"
attr.resolve_types(A)
assert int == attr.fields(A).n.type
assert int is attr.fields(A).n.type
attr.resolve_types(A)
assert int == attr.fields(A).n.type
assert int is attr.fields(A).n.type
@pytest.mark.parametrize(

View File

@ -1099,7 +1099,7 @@ class TestMakeClass:
cls = make_class("C", {})
assert cls.__mro__[-1] == object
assert cls.__mro__[-1] is object
cls = make_class("C", {}, bases=(D,))

View File

@ -36,7 +36,7 @@ class TestNextGen:
A = attrs.make_class("A", classFields)
assert int == attrs.fields(A).testint.type
assert int is attrs.fields(A).testint.type
def test_no_slots(self):
"""