diff --git a/_pytest/vendored_packages/README.md b/_pytest/vendored_packages/README.md index 191b3c4f0..eab7c714f 100644 --- a/_pytest/vendored_packages/README.md +++ b/_pytest/vendored_packages/README.md @@ -6,7 +6,7 @@ package, please see [this issue](https://github.com/pytest-dev/pytest/issues/944 To update the current version, execute: ``` -$ pip install pluggy== --no-compile --target=_pytest/vendored_packages +$ pip install -U pluggy== --no-compile --target=_pytest/vendored_packages ``` And commit the modified files. The `pluggy-.dist-info` directory diff --git a/_pytest/vendored_packages/pluggy.py b/_pytest/vendored_packages/pluggy.py index 3a4fcb1d1..2090dbb4e 100644 --- a/_pytest/vendored_packages/pluggy.py +++ b/_pytest/vendored_packages/pluggy.py @@ -40,7 +40,7 @@ Pluggy currently consists of functionality for: is possible to register plugins for which a hook specification is not yet known and validate all hooks when the system is in a more referentially consistent state. Setting an "optionalhook" attribution to a hook - implementation will avoid PluginValidationError's if a specifcation + implementation will avoid PluginValidationError's if a specification is missing. This allows to have optional integration between plugins. - a "hook" relay object from which you can launch 1:N calls to @@ -67,7 +67,7 @@ Pluggy currently consists of functionality for: import sys import inspect -__version__ = '0.3.0' +__version__ = '0.3.1' __all__ = ["PluginManager", "PluginValidationError", "HookspecMarker", "HookimplMarker"] @@ -763,8 +763,15 @@ class PluginValidationError(Exception): """ plugin failed validation. """ -def _formatdef(func): - return "%s%s" % ( - func.__name__, - inspect.formatargspec(*inspect.getargspec(func)) - ) +if hasattr(inspect, 'signature'): + def _formatdef(func): + return "%s%s" % ( + func.__name__, + str(inspect.signature(func)) + ) +else: + def _formatdef(func): + return "%s%s" % ( + func.__name__, + inspect.formatargspec(*inspect.getargspec(func)) + )