Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow matcher classes to be used directly #3

Open
Xion opened this issue Nov 18, 2015 · 0 comments
Open

Allow matcher classes to be used directly #3

Xion opened this issue Nov 18, 2015 · 0 comments
Labels

Comments

@Xion
Copy link
Owner

Xion commented Nov 18, 2015

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.

@Xion Xion added the idea label Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant