Skip to content

Commit

Permalink
Refactor defaultdict tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yukinarit committed Feb 18, 2024
1 parent 4227fb6 commit 34c6d9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
List,
Set,
Tuple,
FrozenSet,
DefaultDict,
)
from collections import defaultdict
from typing_extensions import TypeAlias

import more_itertools
Expand Down Expand Up @@ -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, ...]),
Expand All @@ -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(
Expand Down

0 comments on commit 34c6d9a

Please sign in to comment.