Skip to content

Commit 9c2c5d9

Browse files
authored
Merge pull request #7501 from nicoddemus/doctest-fixtures
Clarify 'getfixture' needs to access fixtures by normal means
2 parents e7c42ae + 97f560d commit 9c2c5d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/en/doctest.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ It is possible to use fixtures using the ``getfixture`` helper:
206206
>>> ...
207207
>>>
208208
209-
Also, :ref:`usefixtures` and :ref:`autouse` fixtures are supported
209+
Note that the fixture needs to be defined in a place visible by pytest, for example a `conftest.py`
210+
file or plugin; normal python files containing docstrings are not normally scanned for fixtures
211+
unless explicitly configured by :confval:`python_files`.
212+
213+
Also, the :ref:`usefixtures <usefixtures>` mark and fixtures marked as :ref:`autouse <autouse>` are supported
210214
when executing text doctest files.
211215

212216

0 commit comments

Comments
 (0)