-
-
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 infrastructure allowing for test cases for third-party stubs #8700
Conversation
Not reviewed yet, but the list above sounds great! |
0c539a4
to
f5cb01b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Okay, this should now be ready for review! Getting this to work both locally and in CI was a bit of a wild ride. The second commit deliberately introduces errors in stdlib test cases and third-party test cases, to show what it looks like in CI when mypy and pyright fail on those test cases. Unfortunately, it looks like if there are failures in the stdlib test cases, pyright won't then go on to check the third-party test cases. I'm not sure that's fixable without rethinking how we run pyright in CI:
The third commit fixes the errors in the stdlib test cases, so we can see what it looks like when there are only errors in the third-party test cases:
The fourth commit fixes the errors in the third-party test cases, so we're back to how it was in commit 1. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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! A few nits.
Co-authored-by: Jelle Zijlstra <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM, although I skipped some of the code for time constraints. One optional remark and some comment fluff.
SUPPORTED_PLATFORMS = ["linux", "darwin", "win32"] | ||
SUPPORTED_VERSIONS = ["3.11", "3.10", "3.9", "3.8", "3.7"] |
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.
Maybe we should move this into utils.py
as well? Or maybe add a config.py
?
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.
I think it might be better to keep this per-test. We already have one test that supports a narrower version range than this (with good reason, since we're using syntax new to 3.9 in many of our tests).
typeshed/tests/typecheck_typeshed.py
Line 16 in e4d0d3d
SUPPORTED_VERSIONS = ("3.11", "3.10", "3.9") |
And we started testing 3.11 with mypy_test.py
much earlier than we started testing it with stubtest_stdlib.py
.
Co-authored-by: Sebastian Rittau <[email protected]>
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Thanks for the reviews! I'm going to land this now, but happy to address any further feedback anybody has in follow-up PRs :) |
This PR:
tests/mypy_test.py
to a separate script,tests/regr_test.py
.tests/mypy_test.py
andtests/regr_test.py
intotests/colors.py
, and renamestests/colors.py
totests/utils.py
.tests/check_consistent.py
, to enforce the use of# pyright: reportUnnecessaryTypeIgnoreComment=true
comments in third-party test cases. These are essential if we want to have our tests against false-negatives work with pyright.tests.yml
GitHub workflow, to run the new test in CI.requests
, as a regression test for requests: allow passing a list of tuples forfiles
#7998.