-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Move mypy test module exclusions to per-module ignores #13265
base: master
Are you sure you want to change the base?
Conversation
Mypy passes locally for me, as
|
I don't mind a finer-grained exclusion but sometimes it's a pain to update when you add a new test file. I think I encountered the current failures because Concerning the failure it might be because of a local cache. Now, the reason why I used that ignore-list is because of that:
|
If you have a moment, could you try running mypy with this PR? If it is a CI caching issue then we can look at that, but it might be a Linux vs Windows issue. |
Mmh. That's weird. It passes locally as well. I've run this: $ mypy --config-file=pyproject.toml --no-incremental tests
Warning: unused section(s) in pyproject.toml: module = ['pypi_attestations', 'sigstore.models', 'sigstore.verify', 'sigstore.verify.policy', 'tests.test_abc']
Success: no issues found in 165 source files And running only |
If you get rid of [[tool.mypy.overrides]]
module = ["tests.test_util.typing_test_data"]
ignore_errors = true and this will work and IMO be more consistent - having one way to do excludes. |
Purpose
I think this is the right thing to do -- we switch from blanket exclusions of the test modules to finer-grained per-module ignores. This won't catch mutch at the moment as most functions are still untyped, but it has found e.g.
node.getattr(...)
->getattr(node, ...)
. I'd welcome feedback though, as mypy config for the tests has changed a few times. I also don't know if we should attemt a similar thing for Pyright yet.cc @danieleades who originally introduced suggested type-checking for
tests/
in #12097.A
References
tests/
directory #12097