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

mypy ignore errors in tests with assert_called_with() #220

Open
patrikspiess opened this issue Sep 25, 2024 · 0 comments
Open

mypy ignore errors in tests with assert_called_with() #220

patrikspiess opened this issue Sep 25, 2024 · 0 comments

Comments

@patrikspiess
Copy link
Member

When assert_called_with() is used for a mocked method we do a # type:ignore because of mypy error has no attribute "assert_called_with" [attr-defined]
Or worse, sometimes we do a # type:ignore on module level (top of the file)

Better solution would be to just ignore the attr-defined:

# mypy: disable-error-code=attr-defined

Hint:
Search for "assert_called_with(" and remove any # type:ignore (either at line or module level)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant