From 196dcc37a81aa5a0155f10a36a3131338108fa48 Mon Sep 17 00:00:00 2001 From: Brian Maissy Date: Sun, 21 Jan 2018 21:50:26 +0200 Subject: [PATCH] Clarify a possible confusion when using pytest_fixture_setup with fixture functions that return None --- _pytest/hookspec.py | 10 +++++++++- changelog/2698.doc | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/2698.doc diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index c3d550189..595ad6d91 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -358,7 +358,15 @@ def pytest_runtest_logreport(report): def pytest_fixture_setup(fixturedef, request): """ performs fixture setup execution. - Stops at first non-None result, see :ref:`firstresult` """ + :return: The return value of the call to the fixture function + + Stops at first non-None result, see :ref:`firstresult` + + .. note:: + If the fixture function returns None, other implementations of + this hook function will continue to be called, according to the + behavior of the :ref:`firstresult` option. + """ def pytest_fixture_post_finalizer(fixturedef, request): diff --git a/changelog/2698.doc b/changelog/2698.doc new file mode 100644 index 000000000..3088b6efc --- /dev/null +++ b/changelog/2698.doc @@ -0,0 +1 @@ +Clarify a possible confusion when using pytest_fixture_setup with fixture functions that return None. \ No newline at end of file