Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
unittest.case: Further stub improvements#8077
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
AlexWaygood commented Jun 14, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
1 similar comment
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.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
AlexWaygood commented Jun 14, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
These all look good to me.
|
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
1 similar comment
Diff from mypy_primer, showing the effect of this PR on open source code: poetry (https://github.com/python-poetry/poetry) - src/poetry/packages/locker.py:316: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ src/poetry/packages/locker.py:316: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- src/poetry/packages/locker.py:508: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ src/poetry/packages/locker.py:508: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- src/poetry/puzzle/solver.py:138: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ src/poetry/puzzle/solver.py:138: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- src/poetry/console/commands/show.py:395: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ src/poetry/console/commands/show.py:395: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- src/poetry/console/commands/show.py:439: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ src/poetry/console/commands/show.py:439: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return] freqtrade (https://github.com/freqtrade/freqtrade) - freqtrade/persistence/pairlock_middleware.py:90: error: Argument "key" to "sorted" has incompatible type "Callable[[PairLock], Column]"; expected "Callable[[PairLock], Union[SupportsDunderLT, SupportsDunderGT]]"+ freqtrade/persistence/pairlock_middleware.py:90: error: Argument "key" to "sorted" has incompatible type "Callable[[PairLock], Column]"; expected "Callable[[PairLock], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"- freqtrade/persistence/pairlock_middleware.py:90: error: Incompatible return value type (got "Column", expected "Union[SupportsDunderLT, SupportsDunderGT]")+ freqtrade/persistence/pairlock_middleware.py:90: error: Incompatible return value type (got "Column", expected "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]") core (https://github.com/home-assistant/core) - homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return]- homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return] tornado (https://github.com/tornadoweb/tornado) + tornado/test/httpclient_test.py:693: error: Argument 1 to "assertGreaterEqual" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderGE[int]"+ tornado/test/httpclient_test.py:694: error: Argument 1 to "assertLess" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderLT[float]" streamlit (https://github.com/streamlit/streamlit) - lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]" [no-any-return]+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]" [no-any-return] paasta (https://github.com/yelp/paasta) - paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT, SupportsDunderGT]]"+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT, SupportsDunderGT]]"+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]" psycopg (https://github.com/psycopg/psycopg) + tests/test_psycopg_dbapi20.py:43: error: Unused "type: ignore" comment+ tests/test_psycopg_dbapi20.py:44: error: Unused "type: ignore" comment |
srittau commented Jun 20, 2022
Thanks! |
* Update mypy and mypy-zope * Unignore assigning to LogRecord attributes Presumably python/typeshed#8064 makes this ok Cherry-picked from #13521 * Remove unused ignores due to mypy ParamSpec fixespython/mypy#12668 Cherry-picked from #13521 * Remove additional unused ignores * Fix new mypy complaints related to `assertGreater` Presumably due to python/typeshed#8077 * Changelog * Reword changelog Co-authored-by: Patrick Cloke <[email protected]> Co-authored-by: Patrick Cloke <[email protected]>
Fixes several things I noticed while preparing #8066.
objectinstead ofAnywhere literally any argument can be safely passed in.assertGreater,assertLess,assertGreaterEqualandassertLessEqual.assert(Not)IsInstance.