joythief.objects module¶
Matchers for general object types.
- class joythief.objects.Anything(*args, **kwargs)[source]¶
-
Matches anything at all.
Added in version 0.5.0.
The JoyThief version of
unittest.mock.ANY.- Parameters:
args (tp.Any)
kwargs (tp.Any)
- class joythief.objects.InstanceOf(type_, *, nullable=False)[source]¶
-
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.