From f4bfd571ee3902912c3e605c7dede259b1a5e6ec Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 17 Sep 2015 13:54:23 +0200 Subject: [PATCH] re-vendor pluggy to 0.3.1 release and also fix the README --- _pytest/vendored_packages/README.md | 2 +- _pytest/vendored_packages/pluggy.py | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) 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)) + )