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

I want a rule that will check for specs in mock usage #146

Open
kasium opened this issue Sep 27, 2021 · 0 comments
Open

I want a rule that will check for specs in mock usage #146

kasium opened this issue Sep 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@kasium
Copy link
Contributor

kasium commented Sep 27, 2021

Rule request

Description

I think it's a great idea to have a check which enforces the usage of specs in mocks. So either spec, spec_set or autospec should be used when using mock.Mock or mocker.Mock. Same applies to MagicMock.

Rationale

This avoids unintended existence of magic attributes which can lead to non-failing tests even if a bug is introduced.

@kasium kasium added the enhancement New feature or request label Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant