From 97f560d4d1acaacd827fd01e2e9226fa75b5bc6b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 Jul 2020 20:20:23 -0300 Subject: [PATCH] Clarify 'getfixture' needs to access fixtures by normal means Related to #7497 --- doc/en/doctest.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/en/doctest.rst b/doc/en/doctest.rst index bb96ee409..1963214f7 100644 --- a/doc/en/doctest.rst +++ b/doc/en/doctest.rst @@ -206,7 +206,11 @@ It is possible to use fixtures using the ``getfixture`` helper: >>> ... >>> -Also, :ref:`usefixtures` and :ref:`autouse` fixtures are supported +Note that the fixture needs to be defined in a place visible by pytest, for example a `conftest.py` +file or plugin; normal python files containing docstrings are not normally scanned for fixtures +unless explicitly configured by :confval:`python_files`. + +Also, the :ref:`usefixtures ` mark and fixtures marked as :ref:`autouse ` are supported when executing text doctest files.