@@ -244,7 +244,7 @@ Asserting warnings with the warns function
244
244
245
245
246
246
247
- You can check that code raises a particular warning using func:`pytest.warns `,
247
+ You can check that code raises a particular warning using : func: `pytest.warns `,
248
248
which works in a similar manner to :ref: `raises <assertraises >`:
249
249
250
250
.. code-block :: python
@@ -272,7 +272,7 @@ argument ``match`` to assert that the exception matches a text or regex::
272
272
...
273
273
Failed: DID NOT WARN. No warnings of type ...UserWarning... was emitted...
274
274
275
- You can also call func:`pytest.warns ` on a function or code string:
275
+ You can also call : func: `pytest.warns ` on a function or code string:
276
276
277
277
.. code-block :: python
278
278
@@ -307,10 +307,10 @@ filter at the end of the test, so no global state is leaked.
307
307
Recording warnings
308
308
------------------
309
309
310
- You can record raised warnings either using func:`pytest.warns ` or with
310
+ You can record raised warnings either using : func: `pytest.warns ` or with
311
311
the ``recwarn `` fixture.
312
312
313
- To record with func:`pytest.warns ` without asserting anything about the warnings,
313
+ To record with : func: `pytest.warns ` without asserting anything about the warnings,
314
314
pass no arguments as the expected warning type and it will default to a generic Warning:
315
315
316
316
.. code-block :: python
@@ -339,7 +339,7 @@ The ``recwarn`` fixture will record warnings for the whole function:
339
339
assert w.filename
340
340
assert w.lineno
341
341
342
- Both ``recwarn `` and func:`pytest.warns ` return the same interface for recorded
342
+ Both ``recwarn `` and : func: `pytest.warns ` return the same interface for recorded
343
343
warnings: a WarningsRecorder instance. To view the recorded warnings, you can
344
344
iterate over this instance, call ``len `` on it to get the number of recorded
345
345
warnings, or index into it to get a particular recorded warning.
0 commit comments