Skip to content

add docs for specname - #252

Merged
goodboy merged 3 commits into
masterfrom
unknown repository
Jun 7, 2020
Merged

add docs for specname#252
goodboy merged 3 commits into
masterfrom
unknown repository

Conversation

@tlambert03

Copy link
Copy Markdown
Contributor

assuming you choose to merge #251, this PR adds a section to your docs about hook implementation naming and the specname option.

Comment thread docs/index.rst
same name as the function being decorated by ``@hookimpl`` (e.g.
``setup_project`` in the example above).

*new in version 0.13.2:*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously, took a guess at this... feel free to directly edit this (or any other part of this PR).

@goodboy goodboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlambert03 thanks again for the great work!

I added a few comments. Feel free to push back if I'm being too pedantic 😉

Comment thread docs/index.rst Outdated

.. _specname:

Hook implementation naming

@goodboy goodboy Feb 7, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm how about Hook spec selection by name.
That or linking?

edit: or Hookspec name matching as you mentioned below?

Comment thread docs/index.rst Outdated
^^^^^^^^^^^^^^^^^^^^^^^^^^

During plugin :ref:`registration <registration>`, hook implementations are
matched to a hook :ref:`specifications <specs>` in the *host* program with the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matched to a hook :ref:specifications <specs> if provided in the host..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make the sentence read a bit better, I broke into two sentences, restated that there is no string 1-1 requirement, and linked to "enforcing spec validation".

Comment thread docs/index.rst Outdated
*new in version 0.13.2:*

To override the default behavior, a *hookimpl* may also be matched to a
*hookspec* in the ``host program`` with a non-matching name by using the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-matching function name

Comment thread docs/index.rst Outdated
To override the default behavior, a *hookimpl* may also be matched to a
*hookspec* in the ``host program`` with a non-matching name by using the
``specname`` option. Continuing the example above, the *hookimpl* function
does not need to be named ``setup_project``:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not need to be named setup_project but if specname="setup_project" it will be matched and checked against the setup_project hookspec.

@tlambert03

tlambert03 commented Feb 7, 2020

Copy link
Copy Markdown
Contributor Author

I added a few comments. Feel free to push back if I'm being too pedantic 😉

these all work for me! thanks, added (made a slight modification to the if provided sentence... but I think it's the same sentiment).

you ok with it stating new in version 0.13.2:? is that a safe assumption? (and any guesstimate about your release cycle?)

@tlambert03

Copy link
Copy Markdown
Contributor Author

test failed due to HTTP error. closing and reopening to trigger new build.

@tlambert03 tlambert03 closed this Feb 21, 2020
@tlambert03 tlambert03 reopened this Feb 21, 2020
@goodboy
goodboy merged commit 8095fd5 into pytest-dev:master Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants