diff --git a/tests/dicts/test_get.py b/tests/dicts/test_get.py index 54029dcf..84b0cdb0 100644 --- a/tests/dicts/test_get.py +++ b/tests/dicts/test_get.py @@ -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") diff --git a/tests/dicts/test_merge.py b/tests/dicts/test_merge.py index cb0d0151..e6d7723a 100644 --- a/tests/dicts/test_merge.py +++ b/tests/dicts/test_merge.py @@ -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") ] diff --git a/tests/parsers/test_utils.py b/tests/parsers/test_utils.py index 9e460cbc..e80c8dee 100644 --- a/tests/parsers/test_utils.py +++ b/tests/parsers/test_utils.py @@ -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 diff --git a/tests/processors/test_utils.py b/tests/processors/test_utils.py index 029487f4..8b0fa6e9 100644 --- a/tests/processors/test_utils.py +++ b/tests/processors/test_utils.py @@ -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( @@ -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])]), @@ -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(): @@ -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", ), diff --git a/tests/test_singleton.py b/tests/test_singleton.py index 36b1bca9..2088a5be 100644 --- a/tests/test_singleton.py +++ b/tests/test_singleton.py @@ -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 @@ -31,6 +32,7 @@ class A2(A): (a1, a2) = (A(), A2()) assert a1 is a2 + def test_mixins() -> None: class Base: pass