Skip to content

Add on= parameter to Eq #8

@Xion

Description

@Xion

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions