Skip to content

Commit 7cc8094

Browse files
soxofaannicoddemus
andcommitted
Update to use "fixture" rst/sphinx role
Co-authored-by: Bruno Oliveira <[email protected]>
1 parent 0c39cf1 commit 7cc8094

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

changelog/12866.doc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Improved cross-references concerning the :func:`recwarn <_pytest.recwarn.recwarn>` fixture.
1+
Improved cross-references concerning the :fixture:`recwarn` fixture.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ user code and third-party libraries, as recommended by :pep:`565`.
195195
This helps users keep their code modern and avoid breakages when deprecated warnings are effectively removed.
196196

197197
However, in the specific case where users capture any type of warnings in their test, either with
198-
:func:`pytest.warns`, :func:`pytest.deprecated_call` or using the :func:`recwarn <_pytest.recwarn.recwarn>` fixture,
198+
:func:`pytest.warns`, :func:`pytest.deprecated_call` or using the :fixture:`recwarn` fixture,
199199
no warning will be displayed at all.
200200

201201
Sometimes it is useful to hide some specific deprecation warnings that happen in code that you have no control over
@@ -332,10 +332,10 @@ additional information:
332332
assert record[0].message.args[0] == "another warning"
333333
334334
Alternatively, you can examine raised warnings in detail using the
335-
:func:`recwarn <_pytest.recwarn.recwarn>` fixture (see :ref:`below <recwarn>`).
335+
:fixture:`recwarn` fixture (see :ref:`below <recwarn>`).
336336

337337

338-
The :func:`recwarn <_pytest.recwarn.recwarn>` fixture automatically ensures to reset the warnings
338+
The :fixture:`recwarn` fixture automatically ensures to reset the warnings
339339
filter at the end of the test, so no global state is leaked.
340340

341341
.. _`recording warnings`:
@@ -346,7 +346,7 @@ Recording warnings
346346
------------------
347347

348348
You can record raised warnings either using the :func:`pytest.warns` context manager or with
349-
the :func:`recwarn <_pytest.recwarn.recwarn>` fixture.
349+
the :fixture:`recwarn` fixture.
350350

351351
To record with :func:`pytest.warns` without asserting anything about the warnings,
352352
pass no arguments as the expected warning type and it will default to a generic Warning:
@@ -361,7 +361,7 @@ pass no arguments as the expected warning type and it will default to a generic
361361
assert str(record[0].message) == "user"
362362
assert str(record[1].message) == "runtime"
363363
364-
The :func:`recwarn <_pytest.recwarn.recwarn>` fixture will record warnings for the whole function:
364+
The :fixture:`recwarn` fixture will record warnings for the whole function:
365365

366366
.. code-block:: python
367367
@@ -377,7 +377,7 @@ The :func:`recwarn <_pytest.recwarn.recwarn>` fixture will record warnings for t
377377
assert w.filename
378378
assert w.lineno
379379
380-
Both the :func:`recwarn <_pytest.recwarn.recwarn>` fixture and the :func:`pytest.warns` context manager return the same interface for recorded
380+
Both the :fixture:`recwarn` fixture and the :func:`pytest.warns` context manager return the same interface for recorded
381381
warnings: a :class:`~_pytest.recwarn.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.

0 commit comments

Comments
 (0)