Skip to content

Commit 9056db4

Browse files
committed
doc: fix some broken Sphinx references
1 parent a5ee9f2 commit 9056db4

19 files changed

+55
-71
lines changed

changelog/9288.breaking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:func:`pytest.warns <warns>` now re-emits unmatched warnings when the context
1+
:func:`~pytest.warns` now re-emits unmatched warnings when the context
22
closes -- previously it would consume all warnings, hiding those that were not
33
matched by the function.
44

doc/en/backwards-compatibility.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ b) transitional: the old and new API don't conflict
2222

2323
We will only start the removal of deprecated functionality in major releases (e.g. if we deprecate something in 3.0 we will start to remove it in 4.0), and keep it around for at least two minor releases (e.g. if we deprecate something in 3.9 and 4.0 is the next release, we start to remove it in 5.0, not in 4.0).
2424

25-
A deprecated feature scheduled to be removed in major version X will use the warning class `PytestRemovedInXWarning` (a subclass of :class:`~pytest.PytestDeprecationwarning`).
25+
A deprecated feature scheduled to be removed in major version X will use the warning class `PytestRemovedInXWarning` (a subclass of :class:`~pytest.PytestDeprecationWarning`).
2626

2727
When the deprecation expires (e.g. 4.0 is released), we won't remove the deprecated functionality immediately, but will use the standard warning filters to turn `PytestRemovedInXWarning` (e.g. `PytestRemovedIn4Warning`) into **errors** by default. This approach makes it explicit that removal is imminent, and still gives you time to turn the deprecated feature into a warning instead of an error so it can be dealt with in your own time. In the next minor release (e.g. 4.1), the feature will be effectively removed.
2828

doc/en/changelog.rst

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

doc/en/deprecations.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ arguments they only pass on to the superclass.
177177
resolved in future versions as we slowly get rid of the :pypi:`py`
178178
dependency (see :issue:`9283` for a longer discussion).
179179

180-
Due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`
180+
Due to the ongoing migration of methods like :meth:`~pytest.Item.reportinfo`
181181
which still is expected to return a ``py.path.local`` object, nodes still have
182182
both ``fspath`` (``py.path.local``) and ``path`` (``pathlib.Path``) attributes,
183183
no matter what argument was used in the constructor. We expect to deprecate the
@@ -336,7 +336,7 @@ Diamond inheritance between :class:`pytest.Collector` and :class:`pytest.Item`
336336

337337
.. deprecated:: 7.0
338338

339-
Defining a custom pytest node type which is both an :class:`pytest.Item <Item>` and a :class:`pytest.Collector <Collector>` (e.g. :class:`pytest.File <File>`) now issues a warning.
339+
Defining a custom pytest node type which is both an :class:`~pytest.Item` and a :class:`~pytest.Collector` (e.g. :class:`~pytest.File`) now issues a warning.
340340
It was never sanely supported and triggers hard to debug errors.
341341

342342
Some plugins providing linting/code analysis have been using this as a hack.
@@ -348,8 +348,8 @@ Instead, a separate collector node should be used, which collects the item. See
348348

349349
.. _uncooperative-constructors-deprecated:
350350

351-
Constructors of custom :class:`pytest.Node` subclasses should take ``**kwargs``
352-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
351+
Constructors of custom :class:`~_pytest.nodes.Node` subclasses should take ``**kwargs``
352+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353353

354354
.. deprecated:: 7.0
355355

doc/en/example/parametrize.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Parametrizing tests
55
=================================================
66

7-
.. currentmodule:: _pytest.python
8-
97
``pytest`` allows to easily parametrize test functions.
108
For basic docs, see :ref:`parametrize-basics`.
119

@@ -185,7 +183,7 @@ A quick port of "testscenarios"
185183
Here is a quick port to run tests configured with :pypi:`testscenarios`,
186184
an add-on from Robert Collins for the standard unittest framework. We
187185
only have to work a bit to construct the correct arguments for pytest's
188-
:py:func:`Metafunc.parametrize`:
186+
:py:func:`Metafunc.parametrize <pytest.Metafunc.parametrize>`:
189187

190188
.. code-block:: python
191189

doc/en/explanation/fixtures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ A note about fixture cleanup
162162
----------------------------
163163

164164
pytest does not do any special processing for :data:`SIGTERM <signal.SIGTERM>` and
165-
:data:`SIGQUIT <signal.SIGQUIT>` signals (:data:`SIGINT <signal.SIGINT>` is handled naturally
165+
``SIGQUIT`` signals (:data:`SIGINT <signal.SIGINT>` is handled naturally
166166
by the Python runtime via :class:`KeyboardInterrupt`), so fixtures that manage external resources which are important
167167
to be cleared when the Python process is terminated (by those signals) might leak resources.
168168

doc/en/funcarg_compare.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ funcarg mechanism, see :ref:`historical funcargs and pytest.funcargs`.
1111
If you are new to pytest, then you can simply ignore this
1212
section and read the other sections.
1313

14-
.. currentmodule:: _pytest
15-
1614
Shortcomings of the previous ``pytest_funcarg__`` mechanism
1715
--------------------------------------------------------------
1816

doc/en/historical-notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ More details can be found in the :pull:`original PR <3317>`.
112112
.. note::
113113

114114
in a future major release of pytest we will introduce class based markers,
115-
at which point markers will no longer be limited to instances of :py:class:`~_pytest.mark.Mark`.
115+
at which point markers will no longer be limited to instances of :py:class:`~pytest.Mark`.
116116

117117

118118
cache plugin integrated into the core

doc/en/how-to/capture-warnings.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ warnings: a WarningsRecorder instance. To view the recorded warnings, you can
382382
iterate over this instance, call ``len`` on it to get the number of recorded
383383
warnings, or index into it to get a particular recorded warning.
384384

385-
.. currentmodule:: _pytest.warnings
386-
387385
Full API: :class:`~_pytest.recwarn.WarningsRecorder`.
388386

389387
.. _`warns use cases`:

doc/en/how-to/fixtures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ configured in multiple ways.
12711271
Extending the previous example, we can flag the fixture to create two
12721272
``smtp_connection`` fixture instances which will cause all tests using the fixture
12731273
to run twice. The fixture function gets access to each parameter
1274-
through the special :py:class:`request <FixtureRequest>` object:
1274+
through the special :py:class:`request <pytest.FixtureRequest>` object:
12751275

12761276
.. code-block:: python
12771277

0 commit comments

Comments
 (0)