class documentation

class _MatchAfter(BaseMatcher[_A]): (source)

View In Hierarchy

The implementation of after.

Method __init__ Undocumented
Method describe_mismatch Describe the mismatching item or the exception that occurred while pre-processing it.
Method describe_to Create a text description of the match requirement.
Instance Variable f The function to apply.
Instance Variable m The matcher to use on the result.
Method _matches Apply the function and delegate matching on the result.
Instance Variable _e After trying to apply the function fails with an exception, the exception that was raised. This can later be used by describe_mismatch.
def __init__(self, f, m): (source)

Undocumented

Parameters
f:Callable[[_A], _B]Undocumented
m:Matcher[_B]Undocumented
def describe_mismatch(self, item, mismatch_description): (source)

Describe the mismatching item or the exception that occurred while pre-processing it.

Parameters
item:_AUndocumented
mismatch_description:DescriptionUndocumented
Note
Since the exception reporting here depends on mutable state it will only work as long as PyHamcrest calls methods in the right order. The PyHamcrest Matcher interface doesn't seem to allow implementing this functionality in a more reliable way (see the implementation of assert_that).
def describe_to(self, description): (source)

Create a text description of the match requirement.

Parameters
description:DescriptionUndocumented

The function to apply.

The matcher to use on the result.

def _matches(self, item): (source)

Apply the function and delegate matching on the result.

Parameters
item:_AUndocumented
Returns
boolUndocumented

After trying to apply the function fails with an exception, the exception that was raised. This can later be used by describe_mismatch.