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.
Example:
which is equivalent to:
Optionally, if just a string is given to
on=, treat it as an implicit argument toattrgetter, e.g.on='id'.Make
key=an alias foron=for consistency withmax/min/etc.