Skip to content

Commit 34c6d9a

Browse files
committed
Refactor defaultdict tests
1 parent 4227fb6 commit 34c6d9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/common.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
List,
1919
Set,
2020
Tuple,
21+
FrozenSet,
22+
DefaultDict,
2123
)
24+
from collections import defaultdict
2225
from typing_extensions import TypeAlias
2326

2427
import more_itertools
@@ -118,7 +121,7 @@ def yaml_not_supported(se: Any, de: Any, opt: Any) -> bool:
118121
param({1, 2}, Set, toml_not_supported),
119122
param({1, 2}, set, toml_not_supported),
120123
param(set(), Set[int], toml_not_supported),
121-
# TODO param(frozenset({1, 2}), FrozenSet[int], toml_not_supported),
124+
param(frozenset({1, 2}), FrozenSet[int], toml_not_supported),
122125
param((1, 1), Tuple[int, int]),
123126
param((1, 1), Tuple),
124127
param((1, 2, 3), Tuple[int, ...]),
@@ -127,8 +130,8 @@ def yaml_not_supported(se: Any, de: Any, opt: Any) -> bool:
127130
param({"a": 1}, dict),
128131
param({}, Dict[str, int]),
129132
param({"a": 1}, Dict[str, int]),
130-
# TODO param({"a": 1}, DefaultDict[str, int]),
131-
# TODO param({"a": [1]}, DefaultDict[str, List[int]]),
133+
param(defaultdict({"a": 1}.copy), DefaultDict[str, int]),
134+
param(defaultdict({"a": [1]}.copy), DefaultDict[str, List[int]]),
132135
param(data.Pri(10, "foo", 100.0, True), data.Pri), # dataclass
133136
param(data.Pri(10, "foo", 100.0, True), Optional[data.Pri]),
134137
param(

0 commit comments

Comments
 (0)