Fix #81: Stop using 'inspect.getargspec()'#94
Fix #81: Stop using 'inspect.getargspec()'#94RonnyPfannschmidt merged 2 commits intopytest-dev:masterfrom
Conversation
This function is deprecated and raises the warning. DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead While this suggests we use 'inspect.signature()', there's no reason to use this instead of the 'inspect.getfullargspec()', which has almost identical semantics to 'inspect.getargspec()' but handles kwargs-only functions. For what we want though, this is a drop-in replacement. Note that because 'inspect.getfullargspec()' isn't provided in Python 2.7, we may see slightly different behavior between Python 2 and 3 (e.g. for the kwargs-only case above). There's nothing we can do about this without vendoring the entire function. Signed-off-by: Stephen Finucane <stephen@that.guru>
|
pytest already uses funcsigs on the features branch i propose doing the same to get the signature api in all cases (as it will also be more correct in all cases) |
|
Merged with latest |
|
I think we should merge and release |
|
@nicoddemus since when are we at minor version |
|
Oh sorry you are right, we didn't release Merge and release |
|
@RonnyPfannschmidt gentle ping. 😁 |
|
@nicoddemus I was going to say I I feel like we just need a patch release since the only things that have been added since I'll whip something up. |
If you can ship If all goes well I intend to release pytest-3.3 tonight. 👍 |
|
@nicoddemus sounds good! |
|
Cool. Let me know when that's done so I can update pytest's requirements for |
This function is deprecated and raises the warning.
While this suggests we use 'inspect.signature()', there's no reason to
use this instead of the 'inspect.getfullargspec()', which has almost
identical semantics to 'inspect.getargspec()' but handles kwargs-only
functions. For what we want though, this is a drop-in replacement.
Note that because 'inspect.getfullargspec()' isn't provided in Python
2.7, we may see slightly different behavior between Python 2 and 3 (e.g.
for the kwargs-only case above). There's nothing we can do about this
without vendoring the entire function.