Skip to content
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

Future warnings for hookspec changes AND support defaults to enable deprecation #34

Closed
wants to merge 4 commits into from

Commits on Nov 18, 2016

  1. Future warn about hookspec vs. call mis-matches

    Warn when either a hook call doesn't match a hookspec.
    
    Additionally,
    - Extend `varnames()` to return the list of both the arg and
      kwarg names for a function
    - Rename `_MultiCall.kwargs` to `caller_kwargs` to be more explicit
    - Store hookspec kwargs on `_HookRelay` and `HookImpl` instances
    
    Relates to pytest-dev#15
    Tyler Goodlet committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f849553 View commit details
    Browse the repository at this point in the history
  2. Port tests to match new varnames() return value

    Tyler Goodlet committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    22f3b0a View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2016

  1. Add defaults support to enable deprecation

    Add support for using declared keyword argument values from both
    hookspecs and hookimpls. The current logic will inspect the hookimpl
    and, if it contains defaults, values will be first looked up from the
    caller provided data and if not defined will be taken from the
    hookspec's declared defaults. If the spec does not define defaults
    the value is taken from the hookimpl's defaults as is expected under
    normal function call semantics.
    
    Resolves pytest-dev#15
    Tyler Goodlet committed Nov 19, 2016
    Configuration menu
    Copy the full SHA
    d743939 View commit details
    Browse the repository at this point in the history
  2. Add a defaults precedence test

    Verify that defaults declared in hook impls and specs adhere to the
    lookup order: call provided value, hook spec default, and finally
    falling back to the spec's default value.
    Tyler Goodlet committed Nov 19, 2016
    Configuration menu
    Copy the full SHA
    178ffdf View commit details
    Browse the repository at this point in the history