Helpers¶
Utilities for writing Matchers
hasmethod¶
-
hamcrest.core.helpers.hasmethod.hasmethod(obj: object, methodname: str) → bool¶ Does
objhave a method namedmethodname?
wrap_matcher¶
-
hamcrest.core.helpers.wrap_matcher.wrap_matcher(x: Union[hamcrest.core.matcher.Matcher[T], T]) → hamcrest.core.matcher.Matcher[T]¶ Wraps argument in a matcher, if necessary.
- Returns
the argument as-is if it is already a matcher, otherwise wrapped in an
equal_tomatcher.