joythief.compound module

class joythief.compound.AllOf(*matchers)[source]

Bases: _Compound[T]

Matches values which match all of the child matchers.

Note

Unlike all() this comparison is not lazy; all matchers are compared, whether or not any are unequal.

Parameters:

matchers (Matcher[T])

class joythief.compound.AnyOf(*matchers)[source]

Bases: _Compound[T]

Matches values which match any of the child matchers.

Note

Unlike any() this comparison is not lazy; all matchers are compared, whether or not any are equal.

Parameters:

matchers (Matcher[T])

exception joythief.compound.PointlessCompound[source]

Bases: UserWarning

Emitted if you create a compound matcher with a single child matcher.

MESSAGE: ClassVar[str] = 'a compound matcher with a single child matcher can be trivially replaced by that child'
exception joythief.compound.ZeroMatchers[source]

Bases: TypeError

Thrown if you try to create a compound matcher with no child matchers.

Return type:

None

MESSAGE: ClassVar[str] = 'compound matchers require at least one child matcher'