Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-96127: Fixinspect.signature call on mocks#96335
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 ourterms of service andprivacy 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
sobolevn commentedAug 27, 2022
Re-triggering CI. |
graingert commentedSep 12, 2022
I have a similar PR somewhere about this, but I'm on mobile so it's tricky to find |
graingert commentedSep 12, 2022
#94962 is this related? |
sobolevn commentedSep 12, 2022 • edited by AlexWaygood
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by AlexWaygood
Uh oh!
There was an error while loading.Please reload this page.
They are not related as far as I can tell :) Your PR does not fix this exact problem: gh pr checkout 94962 Python 3.12.0a0 (heads/main-dirty:a36235d5c7, Sep 11 2022, 12:23:24) [Clang 11.0.0 (clang-1100.0.33.16)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>import inspect>>>from unittest.mockimport AsyncMock>>> inspect.signature(AsyncMock())Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/sobolev/Desktop/cpython/Lib/inspect.py", line 3272, in signature return Signature.from_callable(obj, follow_wrapped=follow_wrapped, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/inspect.py", line 3020, in from_callable return _signature_from_callable(obj, sigcls=cls, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/inspect.py", line 2507, in _signature_from_callable return _signature_from_function(sigcls, obj, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/sobolev/Desktop/cpython/Lib/inspect.py", line 2351, in _signature_from_function positional = arg_names[:pos_count] ~~~~~~~~~^^^^^^^^^^^^TypeError: 'Mock' object is not subscriptable |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
cjw296 commentedJan 7, 2023
@sobolevn - could you rebase and resolve the conflicts? I think this is then good to land after another quick eyeball from a reviewer... |
sobolevn commentedJan 7, 2023
Sure!
I hope we can land this now! |
zmievsa commentedFeb 1, 2023
@sobolevn this fix saved me big time. Thank you for your amazing work! |
miss-islington commentedFeb 7, 2023
miss-islington commentedFeb 7, 2023
Sorry@sobolevn and@cjw296, I had trouble checking out the |
miss-islington commentedFeb 7, 2023
miss-islington commentedFeb 7, 2023
Sorry,@sobolevn and@cjw296, I could not cleanly backport this to |
(cherry picked from commit9e7d726)
(cherry picked from commit9e7d726)
bedevere-bot commentedFeb 7, 2023
GH-101646 is a backport of this pull request to the3.11 branch. |
bedevere-bot commentedFeb 7, 2023
GH-101647 is a backport of this pull request to the3.10 branch. |
)(cherry picked from commit9e7d726)Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Uh oh!
There was an error while loading.Please reload this page.
Before:
After:
Related#94050