Repository navigation
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 = trueSome 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! |
No description provided.