diff --git a/doc/en/writing_plugins.rst b/doc/en/writing_plugins.rst index accda3634..87d81edb0 100644 --- a/doc/en/writing_plugins.rst +++ b/doc/en/writing_plugins.rst @@ -561,6 +561,7 @@ that result but it's probably better to avoid it. For more information, consult the :ref:`pluggy documentation about hookwrappers `. +.. _plugin-hookorder: Hook function ordering / call example ------------------------------------- diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 962ec8b3a..210cf2255 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -528,6 +528,13 @@ def pytest_report_header(config, startdir): :param _pytest.config.Config config: pytest config object :param startdir: py.path object with the starting dir + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. + .. note:: This function should be implemented only in plugins or ``conftest.py`` @@ -542,11 +549,18 @@ def pytest_report_collectionfinish(config, startdir, items): return a string or list of strings to be displayed after collection has finished successfully. - This strings will be displayed after the standard "collected X items" message. + These strings will be displayed after the standard "collected X items" message. :param _pytest.config.Config config: pytest config object :param startdir: py.path object with the starting dir :param items: list of pytest items that are going to be executed; this list should not be modified. + + .. note:: + + Lines returned by a plugin are displayed before those of plugins which + ran before it. + If you want to have your line(s) displayed first, use + :ref:`trylast=True `. """