Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 13, 2024
1 parent 2017547 commit c4e6f3b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 40 deletions.
6 changes: 2 additions & 4 deletions src/hamcrest/core/assert_that.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@


@overload
def assert_that(actual_or_assertion: T, matcher: Matcher[T], reason: str = "") -> None:
...
def assert_that(actual_or_assertion: T, matcher: Matcher[T], reason: str = "") -> None: ...


@overload
def assert_that(actual_or_assertion: bool, reason: str = "") -> None:
...
def assert_that(actual_or_assertion: bool, reason: str = "") -> None: ...


def assert_that(actual_or_assertion, matcher=None, reason=""):
Expand Down
15 changes: 5 additions & 10 deletions src/hamcrest/core/core/is_.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ def describe_to(self, description: Description):


@overload
def _wrap_value_or_type(x: Type) -> Matcher[object]:
...
def _wrap_value_or_type(x: Type) -> Matcher[object]: ...


@overload
def _wrap_value_or_type(x: T) -> Matcher[T]:
...
def _wrap_value_or_type(x: T) -> Matcher[T]: ...


def _wrap_value_or_type(x):
Expand All @@ -46,18 +44,15 @@ def _wrap_value_or_type(x):


@overload
def is_(x: Type) -> Matcher[Any]:
...
def is_(x: Type) -> Matcher[Any]: ...


@overload
def is_(x: Matcher[T]) -> Matcher[T]:
...
def is_(x: Matcher[T]) -> Matcher[T]: ...


@overload
def is_(x: T) -> Matcher[T]:
...
def is_(x: T) -> Matcher[T]: ...


def is_(x):
Expand Down
12 changes: 4 additions & 8 deletions src/hamcrest/core/core/isnot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ def describe_mismatch(self, item: T, mismatch_description: Description) -> None:


@overload
def _wrap_value_or_type(x: Type) -> Matcher[object]:
...
def _wrap_value_or_type(x: Type) -> Matcher[object]: ...


@overload
def _wrap_value_or_type(x: T) -> Matcher[T]:
...
def _wrap_value_or_type(x: T) -> Matcher[T]: ...


def _wrap_value_or_type(x):
Expand All @@ -47,13 +45,11 @@ def _wrap_value_or_type(x):


@overload
def is_not(match: Type) -> Matcher[object]:
...
def is_not(match: Type) -> Matcher[object]: ...


@overload
def is_not(match: Union[Matcher[T], T]) -> Matcher[T]:
...
def is_not(match: Union[Matcher[T], T]) -> Matcher[T]: ...


def is_not(match):
Expand Down
1 change: 1 addition & 0 deletions src/hamcrest/library/collection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Matchers of collections."""

from .is_empty import empty
from .isdict_containing import has_entry
from .isdict_containingentries import has_entries
Expand Down
9 changes: 3 additions & 6 deletions src/hamcrest/library/collection/isdict_containingentries.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,17 @@ def describe_to(self, description: Description) -> None:

# Keyword argument form
@overload
def has_entries(**keys_valuematchers: Union[Matcher[V], V]) -> Matcher[Mapping[str, V]]:
...
def has_entries(**keys_valuematchers: Union[Matcher[V], V]) -> Matcher[Mapping[str, V]]: ...


# Key to matcher dict form
@overload
def has_entries(keys_valuematchers: Mapping[K, Union[Matcher[V], V]]) -> Matcher[Mapping[K, V]]:
...
def has_entries(keys_valuematchers: Mapping[K, Union[Matcher[V], V]]) -> Matcher[Mapping[K, V]]: ...


# Alternating key/matcher form
@overload
def has_entries(*keys_valuematchers: Any) -> Matcher[Mapping[Any, Any]]:
...
def has_entries(*keys_valuematchers: Any) -> Matcher[Mapping[Any, Any]]: ...


def has_entries(*keys_valuematchers, **kv_args):
Expand Down
6 changes: 2 additions & 4 deletions src/hamcrest/library/number/iscloseto.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ def describe_to(self, description: Description) -> None:


@overload
def close_to(value: float, delta: float) -> Matcher[float]:
...
def close_to(value: float, delta: float) -> Matcher[float]: ...


@overload
def close_to(value: Decimal, delta: Decimal) -> Matcher[Decimal]:
...
def close_to(value: Decimal, delta: Decimal) -> Matcher[Decimal]: ...


def close_to(value, delta):
Expand Down
9 changes: 3 additions & 6 deletions src/hamcrest/library/object/hasproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,17 @@ def has_property(name: str, match: Union[None, Matcher[V], V] = None) -> Matcher

# Keyword argument form
@overload
def has_properties(**keys_valuematchers: Union[Matcher[V], V]) -> Matcher[Any]:
...
def has_properties(**keys_valuematchers: Union[Matcher[V], V]) -> Matcher[Any]: ...


# Name to matcher dict form
@overload
def has_properties(keys_valuematchers: Mapping[str, Union[Matcher[V], V]]) -> Matcher[Any]:
...
def has_properties(keys_valuematchers: Mapping[str, Union[Matcher[V], V]]) -> Matcher[Any]: ...


# Alternating name/matcher form
@overload
def has_properties(*keys_valuematchers: Any) -> Matcher[Any]:
...
def has_properties(*keys_valuematchers: Any) -> Matcher[Any]: ...


def has_properties(*keys_valuematchers, **kv_args):
Expand Down
3 changes: 1 addition & 2 deletions src/hamcrest/library/text/substringmatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ def describe_to(self, description: Description) -> None:
).append_description_of(self.substring)

@abstractmethod
def relationship(self):
...
def relationship(self): ...

0 comments on commit c4e6f3b

Please sign in to comment.