Skip to content

Commit

Permalink
fix: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed Apr 27, 2024
1 parent 182c95e commit a70b255
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
3 changes: 0 additions & 3 deletions tests/dicts/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

from . import common

if typing.TYPE_CHECKING:
import pathlib


DATASETS: list[tuple[typing.Any, dict[str, typing.Any]]] = [
(obj, data) for _, obj, data in common.collect_data("get")
Expand Down
4 changes: 0 additions & 4 deletions tests/dicts/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
from . import common


if typing.TYPE_CHECKING:
import pathlib


DATASETS: list[tuple[typing.Any, dict[str, typing.Any]]] = [
(obj, data) for _, obj, data in common.collect_data("merge")
]
Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from anyconfig.backend.json import PARSERS as JSON_PSR_CLSS


PSRS =anyconfig.parsers.parsers.Parsers().list()
PSRS = anyconfig.parsers.parsers.Parsers().list()
JSON_PSRS = sorted(
(p() for p in JSON_PSR_CLSS),
key=operator.methodcaller("priority"), reverse=True
Expand Down
11 changes: 7 additions & 4 deletions tests/processors/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
(([], []),
(((["a"], 1), ), [("a", [1])]),
(((["a", "aaa"], 1), (["b", "bb"], 2), (["a"], 3)),
[("a", [1, 3]), ("aaa", [1]), ("b", [2]), ("bb", [2])])
[("a", [1, 3]), ("aaa", [1]), ("b", [2]), ("bb", [2])])
),
)
def test_select_by_key(
Expand Down Expand Up @@ -63,8 +63,10 @@ def sfn(itr):
(([AI0], "type"), [(AI0.type(), [AI0])]),
(([AI0], "extensions"), [(x, [AI0]) for x in AI0.extensions()]),
(((AI0, AI2, AI3), "type"), [(AI0.type(), [AI3, AI2, AI0])]),
(([AI0, BI0, CI0], "type"), [(AI0.type(), [AI0]), (BI0.type(), [BI0, CI0])]),
((PRS, "type"), [(AI0.type(), [AI3, AI2, AI0]), (BI0.type(), [BI0, CI0])]),
(([AI0, BI0, CI0], "type"),
[(AI0.type(), [AI0]), (BI0.type(), [BI0, CI0])]),
((PRS, "type"),
[(AI0.type(), [AI3, AI2, AI0]), (BI0.type(), [BI0, CI0])]),
((PRS, "extensions"),
[("js", [AI3, AI2, AI0]), ("json", [AI3, AI2, AI0]),
("jsn", [AI3, AI2, AI0]), ("yaml", [BI0, CI0]), ("yml", [BI0, CI0])]),
Expand All @@ -73,7 +75,7 @@ def sfn(itr):
def test_list_by_x(
items: collections.abc.Iterable, exp: collections.abc.Iterable
) -> None:
assert sorted(TT.list_by_x(*items)) == sorted(exp)
assert sorted(TT.list_by_x(*items)) == sorted(exp)


def test_list_by_x_ng_cases():
Expand Down Expand Up @@ -176,6 +178,7 @@ def test_find_by_fileext_ng_cases():
def test_find_by_maybe_file(objs, exp):
assert TT.find_by_maybe_file(*objs) == exp


@pytest.mark.parametrize(
("obj", ),
(("/tmp/x.xyz", ),
Expand Down
2 changes: 2 additions & 0 deletions tests/test_singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class B(TT.Singleton):
assert b1 is b2
assert a1 is not b1


def test_descendants() -> None:
class A(TT.Singleton):
pass
Expand All @@ -31,6 +32,7 @@ class A2(A):
(a1, a2) = (A(), A2())
assert a1 is a2


def test_mixins() -> None:
class Base:
pass
Expand Down

0 comments on commit a70b255

Please sign in to comment.