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

Document pytest_report_header and conftest behavior #2261

Merged
merged 2 commits into from
Feb 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions _pytest/hookspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def pytest_unconfigure(config):


# -------------------------------------------------------------------------
# hooks for customising the assert methods
# hooks for customizing the assert methods
# -------------------------------------------------------------------------

def pytest_assertrepr_compare(config, op, left, right):
Expand All @@ -263,7 +263,14 @@ def pytest_assertrepr_compare(config, op, left, right):
# -------------------------------------------------------------------------

def pytest_report_header(config, startdir):
""" return a string to be displayed as header info for terminal reporting."""
""" return a string to be displayed as header info for terminal reporting.

.. note::

This function should be implemented only in plugins or ``conftest.py``
files situated at the tests root directory due to how pytest
:ref:`discovers plugins during startup <pluginorder>`.
"""

@hookspec(firstresult=True)
def pytest_report_teststatus(report):
Expand Down