Skip to content

Commit daf1de0

Browse files
committed
Add reference docs for pytest_sessionstart/finish and update their docstrings
1 parent f1c9efc commit daf1de0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

_pytest/hookspec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,15 @@ def pytest_fixture_post_finalizer(fixturedef, request):
413413

414414

415415
def pytest_sessionstart(session):
416-
""" before session.main() is called.
416+
""" called after the ``Session`` object has been created and before performing collection
417+
and entering the run test loop.
417418
418419
:param _pytest.main.Session session: the pytest session object
419420
"""
420421

421422

422423
def pytest_sessionfinish(session, exitstatus):
423-
""" whole test run finishes.
424+
""" called after whole test run finished, right before returning the exit status to the system.
424425
425426
:param _pytest.main.Session session: the pytest session object
426427
:param int exitstatus: the status which pytest will return to the system

doc/en/reference.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ Initialization hooks called for plugins and ``conftest.py`` files.
527527
.. autofunction:: pytest_addhooks
528528
.. autofunction:: pytest_configure
529529
.. autofunction:: pytest_unconfigure
530+
.. autofunction:: pytest_sessionstart
531+
.. autofunction:: pytest_sessionfinish
530532

531533
Test running hooks
532534
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)