From 8994603d46d32abc50f50a8967ed042c764b2172 Mon Sep 17 00:00:00 2001 From: Brian Maissy Date: Sun, 21 Jan 2018 23:17:16 +0200 Subject: [PATCH 1/2] Document hooks (defined with historic=True) which cannot be used with hookwrapper=True --- _pytest/hookspec.py | 21 ++++++++++++++++++++- changelog/2423.doc | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changelog/2423.doc diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index c3d550189..417a9de56 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -16,6 +16,9 @@ def pytest_addhooks(pluginmanager): :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. 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 _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`` 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 imported. + .. note:: + This hook is incompatible with ``hookwrapper=True``. + :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): """ process a warning specified by a message, a code string, 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 diff --git a/changelog/2423.doc b/changelog/2423.doc new file mode 100644 index 000000000..a28bf02d4 --- /dev/null +++ b/changelog/2423.doc @@ -0,0 +1 @@ +Document hooks (defined with historic=True) which cannot be used with hookwrapper=True. \ No newline at end of file From 8a8797df8034fb37ced96406429fe6f1b28bbf1b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 21 Jan 2018 23:21:21 -0200 Subject: [PATCH 2/2] Small changelog formatting --- changelog/2423.doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/2423.doc b/changelog/2423.doc index a28bf02d4..96cc68297 100644 --- a/changelog/2423.doc +++ b/changelog/2423.doc @@ -1 +1 @@ -Document hooks (defined with historic=True) which cannot be used with hookwrapper=True. \ No newline at end of file +Document hooks (defined with ``historic=True``) which cannot be used with ``hookwrapper=True``.