Repository navigation
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.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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.
srittau
left a comment
There was a problem hiding this comment.
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.
Maybe we should move this into utils.py as well? Or maybe add a config.py?
There was a problem hiding this comment.
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
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 <srittau@rittau.biz>
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.pyto a separate script,tests/regr_test.py.tests/mypy_test.pyandtests/regr_test.pyintotests/colors.py, and renamestests/colors.pytotests/utils.py.tests/check_consistent.py, to enforce the use of# pyright: reportUnnecessaryTypeIgnoreComment=truecomments in third-party test cases. These are essential if we want to have our tests against false-negatives work with pyright.tests.ymlGitHub workflow, to run the new test in CI.requests, as a regression test for requests: allow passing a list of tuples forfiles#7998.