From 34c6d9aabcf7a1644a8d886b567e3d382e0a5b1e Mon Sep 17 00:00:00 2001 From: yukinarit Date: Sun, 18 Feb 2024 20:04:11 +0900 Subject: [PATCH] Refactor defaultdict tests --- tests/common.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/common.py b/tests/common.py index 99daf12d..70c114e4 100644 --- a/tests/common.py +++ b/tests/common.py @@ -18,7 +18,10 @@ List, Set, Tuple, + FrozenSet, + DefaultDict, ) +from collections import defaultdict from typing_extensions import TypeAlias import more_itertools @@ -118,7 +121,7 @@ def yaml_not_supported(se: Any, de: Any, opt: Any) -> bool: param({1, 2}, Set, toml_not_supported), param({1, 2}, set, toml_not_supported), param(set(), Set[int], toml_not_supported), - # TODO param(frozenset({1, 2}), FrozenSet[int], toml_not_supported), + param(frozenset({1, 2}), FrozenSet[int], toml_not_supported), param((1, 1), Tuple[int, int]), param((1, 1), Tuple), param((1, 2, 3), Tuple[int, ...]), @@ -127,8 +130,8 @@ def yaml_not_supported(se: Any, de: Any, opt: Any) -> bool: param({"a": 1}, dict), param({}, Dict[str, int]), param({"a": 1}, Dict[str, int]), - # TODO param({"a": 1}, DefaultDict[str, int]), - # TODO param({"a": [1]}, DefaultDict[str, List[int]]), + param(defaultdict({"a": 1}.copy), DefaultDict[str, int]), + param(defaultdict({"a": [1]}.copy), DefaultDict[str, List[int]]), param(data.Pri(10, "foo", 100.0, True), data.Pri), # dataclass param(data.Pri(10, "foo", 100.0, True), Optional[data.Pri]), param(