diff --git a/pyproject.toml b/pyproject.toml index 924c1986..3246a854 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,7 @@ source = "uv-dynamic-versioning" line-length = 99 [tool.ruff.lint] -select = ["I", "UP"] -# TODO: Fix the imports in __init__.py files and enable these: -# select = ["E4", "E7", "E9", "I", "UP"] +select = ["E4", "E7", "E9", "I", "UP"] [tool.docformatter] in-place = true diff --git a/test/test_decoding.py b/test/test_decoding.py index fcfe09ac..2de7fcaf 100644 --- a/test/test_decoding.py +++ b/test/test_decoding.py @@ -24,14 +24,14 @@ def test_encode_something(simple_attribute): @dataclass class SomeClass(Serializable): - d: dict[str, some_type] = dict_field() - l: list[tuple[some_type, some_type]] = list_field() - t: dict[str, Optional[some_type]] = dict_field() + d: dict[str, some_type] = dict_field() # pyright: ignore[reportInvalidTypeForm] + some_list: list[tuple[some_type, some_type]] = list_field() # pyright: ignore[reportInvalidTypeForm] + t: dict[str, Optional[some_type]] = dict_field() # pyright: ignore[reportInvalidTypeForm] # w: Dict[str, Union[some_type, int, str, None, str, None]] = dict_field() b = SomeClass() b.d.update({"hey": expected_value}) - b.l.append((expected_value, expected_value)) + b.some_list.append((expected_value, expected_value)) b.t.update({"hey": None, "hey2": expected_value}) # b.w.update({ # "hey": None, @@ -85,14 +85,14 @@ class Container(Serializable, Generic[ItemT]): @dataclass class SomeClass(Serializable): - d: dict[str, some_type] = dict_field() - l: list[tuple[some_type, some_type]] = list_field() - t: dict[str, Optional[some_type]] = dict_field() + d: dict[str, some_type] = dict_field() # pyright: ignore[reportInvalidTypeForm] + some_list: list[tuple[some_type, some_type]] = list_field() # pyright: ignore[reportInvalidTypeForm] + t: dict[str, Optional[some_type]] = dict_field() # pyright: ignore[reportInvalidTypeForm] # w: Dict[str, Union[some_type, int, str, None, str, None]] = dict_field() b = SomeClass() b.d.update({"hey": expected_value}) - b.l.append((expected_value, expected_value)) + b.some_list.append((expected_value, expected_value)) b.t.update({"hey": None, "hey2": expected_value}) # b.w.update({ # "hey": None, diff --git a/test/test_union.py b/test/test_union.py index 4c0027dd..59243fbb 100644 --- a/test/test_union.py +++ b/test/test_union.py @@ -16,7 +16,7 @@ class Foo(TestSetup): assert foo.x == "bob" foo = Foo.setup("--x 2") - assert foo.x == 2 and type(foo.x) is int + assert foo.x == 2 and isinstance(foo.x, int) def test_union_type_raises_error(): @@ -31,4 +31,4 @@ class Foo2(TestSetup): foo = Foo2.setup("--x bob") foo = Foo2.setup("--x 2") - assert foo.x == 2 and type(foo.x) is int + assert foo.x == 2 and isinstance(foo.x, int)