Merge pull request #3137 from brianmaissy/doc/note_that_certain_hooks_cant_be_used_with_hookwrapper

Document hooks (defined with historic=True) which cannot be used with hookwrapper=True
This commit is contained in:
Bruno Oliveira 2018-01-22 18:00:35 -02:00 committed by GitHub
commit 060f68bd90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -16,6 +16,9 @@ def pytest_addhooks(pluginmanager):
:param _pytest.config.PytestPluginManager pluginmanager: pytest plugin manager :param _pytest.config.PytestPluginManager pluginmanager: pytest plugin manager
.. note::
This hook is incompatible with ``hookwrapper=True``.
""" """
@ -27,6 +30,9 @@ def pytest_namespace():
the pytest namespace. the pytest namespace.
This hook is called at plugin registration time. This hook is called at plugin registration time.
.. note::
This hook is incompatible with ``hookwrapper=True``.
""" """
@ -36,6 +42,9 @@ def pytest_plugin_registered(plugin, manager):
:param plugin: the plugin module or instance :param plugin: the plugin module or instance
:param _pytest.config.PytestPluginManager manager: pytest plugin manager :param _pytest.config.PytestPluginManager manager: pytest plugin manager
.. note::
This hook is incompatible with ``hookwrapper=True``.
""" """
@ -66,6 +75,9 @@ def pytest_addoption(parser):
The config object is passed around on many internal objects via the ``.config`` The config object is passed around on many internal objects via the ``.config``
attribute or can be retrieved as the ``pytestconfig`` fixture. attribute or can be retrieved as the ``pytestconfig`` fixture.
.. note::
This hook is incompatible with ``hookwrapper=True``.
""" """
@ -80,6 +92,9 @@ def pytest_configure(config):
After that, the hook is called for other conftest files as they are After that, the hook is called for other conftest files as they are
imported. imported.
.. note::
This hook is incompatible with ``hookwrapper=True``.
:arg _pytest.config.Config config: pytest config object :arg _pytest.config.Config config: pytest config object
""" """
@ -456,7 +471,11 @@ def pytest_terminal_summary(terminalreporter, exitstatus):
def pytest_logwarning(message, code, nodeid, fslocation): def pytest_logwarning(message, code, nodeid, fslocation):
""" process a warning specified by a message, a code string, """ process a warning specified by a message, a code string,
a nodeid and fslocation (both of which may be None a nodeid and fslocation (both of which may be None
if the warning is not tied to a partilar node/location).""" if the warning is not tied to a partilar node/location).
.. note::
This hook is incompatible with ``hookwrapper=True``.
"""
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# doctest hooks # doctest hooks

1
changelog/2423.doc Normal file
View File

@ -0,0 +1 @@
Document hooks (defined with ``historic=True``) which cannot be used with ``hookwrapper=True``.