Skip to content

Commit 8c5c1bb

Browse files
committed
doc: fix pytest_load_initial_conftests example referring to conftest.py
The 'Dynamically adding command line options' example defines pytest_load_initial_conftests under a '# installable external plugin' comment but the following prose called it 'the above conftest.py'. This contradicts the hook reference, which states the hook is not called for conftest files. Refer to it as a plugin instead. Closes #4482
1 parent 83b0220 commit 8c5c1bb

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

changelog/4482.doc.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Corrected the "Dynamically adding command line options" example so it no longer
2+
refers to the ``pytest_load_initial_conftests`` hook as living in a
3+
``conftest.py``. As noted in the hook reference, ``pytest_load_initial_conftests``
4+
is not called for ``conftest.py`` files and must be provided by an installable
5+
plugin.

doc/en/example/simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ the command line arguments before they get processed:
229229
If you have the :pypi:`xdist plugin <pytest-xdist>` installed
230230
you will now always perform test runs using a number
231231
of subprocesses close to your CPU. Running in an empty
232-
directory with the above conftest.py:
232+
directory with the above plugin:
233233

234234
.. code-block:: pytest
235235

0 commit comments

Comments
 (0)