From daf1de0fedeeb320d4f4597aa0991acde4efb3f2 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 29 Mar 2018 19:48:48 -0300 Subject: [PATCH] Add reference docs for pytest_sessionstart/finish and update their docstrings --- _pytest/hookspec.py | 5 +++-- doc/en/reference.rst | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index 70349416e..f5bdfabc5 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -413,14 +413,15 @@ def pytest_fixture_post_finalizer(fixturedef, request): 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 """ 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 int exitstatus: the status which pytest will return to the system diff --git a/doc/en/reference.rst b/doc/en/reference.rst index d87ec28f3..ef7f8f51f 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -527,6 +527,8 @@ Initialization hooks called for plugins and ``conftest.py`` files. .. autofunction:: pytest_addhooks .. autofunction:: pytest_configure .. autofunction:: pytest_unconfigure +.. autofunction:: pytest_sessionstart +.. autofunction:: pytest_sessionfinish Test running hooks ~~~~~~~~~~~~~~~~~~