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
https://mypy-play.net/?mypy=latest&python=3.10&gist=6f7d6d1036646b8e8a41ed3a5dab3b98&flags=strict
from unittest import mock import subprocess def foo() -> None: with mock.patch.object( subprocess, "Popen", **{"return_value.communicate.side_effect": KeyboardInterrupt} ): pass
The text was updated successfully, but these errors were encountered:
mock.patch.object() should probably be marked as a staticmethod in the stubs. (The same for dict(), multiple(), and stopall().)
mock.patch.object()
staticmethod
dict()
multiple()
stopall()
Make unittest.patch.* methods static
f49ec6c
Closes: python#7542
Reopening as per #7543 (review) -- the original snippet still causes mypy to emit a false-positive error, even using mypy master and typeshed master.
https://mypy-play.net/?mypy=latest&python=3.10&gist=6f7d6d1036646b8e8a41ed3a5dab3b98&flags=strict
The text was updated successfully, but these errors were encountered: