-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add misc types for mock and unittest.mock #3923
Conversation
Looks uncontroversial, CI failures apart.
|
We don't type |
@hauntsaninja thanks for the advice! I added those changes and pushed up @srittau for some more context, I'm trying to work around this error: $ mypy example.py
example.py:2: error: Module has no attribute "__all__"
example.py:3: error: Module has no attribute "__all__" Where import unittest.mock, mock
print(unittest.mock.__all__)
print(mock.__all__) And $ mypy --version
mypy 0.770
$ cat setup.cfg
[mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true Some info about my system (code here):
I've seen |
@mxr Sorry for the delay. I was wrong with my answer. We discussed |
Thank you for the changes. Regarding the build failures:
|
Thanks for the review! Since enumerating the contents of |
If this is a quick fix in pytype I'd prefer the "correct" solution, otherwise we can fall back to using the annotation only. |
I'll look into fixing our parser. In the meantime, would it work to write
? (Remove the annotation and use a list instead of a tuple?) pytype should already support that because it's the same syntax we use for slots. |
@rchen152 sure I'll do that. Thanks! |
CI is still unhappy. The stubtest failures are unrelated and should go away if you rebase, but the flake8 errors look real. |
Actually they're not; the names are all defined. #3940 should fix this, so PR should now pass completely. |
Will rebase. Thanks again, everyone, for all the guidance and white glove service on this PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sticking it out despite the various errors unrelated to this PR!
No description provided.