Skip to content

Commit

Permalink
refactor: Use more precise types for dict_true_values and `dict_not…
Browse files Browse the repository at this point in the history
…_none_values`
  • Loading branch information
Stranger6667 committed Dec 11, 2019
1 parent 200cc54 commit 437937d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schemathesis/utils.py
Expand Up @@ -3,7 +3,7 @@
import warnings
from contextlib import contextmanager
from functools import wraps
from typing import Any, Callable, Generator, List, Mapping, Set, Tuple, Type, Union
from typing import Any, Callable, Dict, Generator, List, Set, Tuple, Type, Union
from urllib.parse import urlsplit, urlunsplit

import yaml
Expand Down Expand Up @@ -45,12 +45,12 @@ def force_tuple(item: Filter) -> Union[List, Set, Tuple]:
return item


def dict_true_values(**kwargs: Any) -> Mapping[str, Any]:
def dict_true_values(**kwargs: Any) -> Dict[str, Any]:
"""Create dict with given kwargs while skipping items where bool(value) evaluates to False."""
return {key: value for key, value in kwargs.items() if bool(value)}


def dict_not_none_values(**kwargs: Any) -> Mapping[str, Any]:
def dict_not_none_values(**kwargs: Any) -> Dict[str, Any]:
return {key: value for key, value in kwargs.items() if value is not None}


Expand Down

0 comments on commit 437937d

Please sign in to comment.