Merge pull request #3357 from nicoddemus/session-hooks-ref

Add reference docs for pytest_sessionstart/finish and update their docstrings
This commit is contained in:
Ronny Pfannschmidt 2018-04-03 07:08:47 +02:00 committed by GitHub
commit 9326759a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -413,14 +413,15 @@ def pytest_fixture_post_finalizer(fixturedef, request):
def pytest_sessionstart(session): def pytest_sessionstart(session):
""" before session.main() is called. """ called after the ``Session`` object has been created and before performing collection
and entering the run test loop.
:param _pytest.main.Session session: the pytest session object :param _pytest.main.Session session: the pytest session object
""" """
def pytest_sessionfinish(session, exitstatus): def pytest_sessionfinish(session, exitstatus):
""" whole test run finishes. """ called after whole test run finished, right before returning the exit status to the system.
:param _pytest.main.Session session: the pytest session object :param _pytest.main.Session session: the pytest session object
:param int exitstatus: the status which pytest will return to the system :param int exitstatus: the status which pytest will return to the system

View File

@ -527,6 +527,8 @@ Initialization hooks called for plugins and ``conftest.py`` files.
.. autofunction:: pytest_addhooks .. autofunction:: pytest_addhooks
.. autofunction:: pytest_configure .. autofunction:: pytest_configure
.. autofunction:: pytest_unconfigure .. autofunction:: pytest_unconfigure
.. autofunction:: pytest_sessionstart
.. autofunction:: pytest_sessionfinish
Test running hooks Test running hooks
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~