callee
callee copied to clipboard
Add on= parameter to Eq
Example:
mock_foo.assert_called_with(Eq(expected, on=attrgetter('id')))
which is equivalent to:
mock_foo.assert_called_with(ArgThat(lambda x: x.id == expected.id))
Optionally, if just a string is given to on=, treat it as an implicit argument to attrgetter, e.g. on='id'.
Make key= an alias for on= for consistency with max/min/etc.