Skip to content

Allow matcher classes to be used directly #3

@Xion

Description

@Xion

For matchers that are rarely/never parametrized (like Integer), the pair of parentheses required for their instantation is kind of a boilerplate. Ideally, we'd want the following two lines to be equivalent:

mock_foo.assert_called_with(Integer())
mock_foo.assert_called_with(Integer)

This is theoretically possible by copying the crucial magic methods (mostly __eq__) from BaseMatcher to BaseMatcherMetaclass (likely through a shared mixin). It would have to be investigated, however, that there are no adverse effects of doing so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions