joythief.objects module¶
Matchers for general object types.
- class joythief.objects.Anything[source]¶
Bases:
Matcher[T]Matches anything at all.
Added in version 0.5.0.
The JoyThief version of
unittest.mock.ANY.
- class joythief.objects.InstanceOf(type_, *, nullable=False)[source]¶
Bases:
Matcher[T]Matches any instance of the specified type(s).
This matcher compares the received value using
isinstance(), so accepts either a single type or a tuple of types. Withnullableset toTrue, the received value can also beNone.Originally formulated for this answer.