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
Python 3.8: DeprecationWarning: Use inspect.signature() instead of inspect.getfullargspec() #209
Comments
Hi @hroncok, Thanks for the report! I think we should update pluggy to not use the deprecated function in Python 3.8. |
I agree. Any idea if it is pluggy, pytest or the tested project that handles the DeprecationWarning as an error? |
It should be the project itself which configures this. |
Thanks for clarifying. |
This was done as part of PEP 570 implementation in commit python/cpython@d5d2b454693 in alpha 4. There is a discussion in CPython about reverting the deprecation marked as release blocker for Python 3.8 beta 1 : https://bugs.python.org/issue36751#msg342156 |
The discussion seems ongoing. I'd say that migrating to |
This is the stuff that pluggy currently uses: signature = inspect.signature(func)
args = tuple(signature.parameters)
defaults = tuple(param.default for param in signature.parameters.values() if param.default is not inspect.Parameter.empty) |
@nicoddemus You've assigned this to yourself. I'll try to test the above code and submit a PR if it works. Let me know if you are already in the middle of the same. |
Avoids a possible deprecation warning with inspect.getfullargspec() Fixes pytest-dev#209
A lot of Fedora packages, when rebuilt with Python 3.8.0a4 fail to collect tests with pytest:
Now I don't know if treating this
DeprecationWarning
as error is the default pytest behavior or specific projects (mis)configuration, but the warning comes from pluggy. We still have 0.9.0, but I seegetfullargspec()
even in master.The text was updated successfully, but these errors were encountered: