Skip to content

Commit

Permalink
doc: Add ellipsis to warning usecase list (#9558)
Browse files Browse the repository at this point in the history
I feel like this makes it clearer where the code which was inside 'pytest.warns' is supposed to go.
  • Loading branch information
The-Compiler committed Jan 27, 2022
1 parent f064942 commit 843f03e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/en/how-to/capture-warnings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,23 @@ Here are some use cases involving warnings that often come up in tests, and sugg
.. code-block:: python
with pytest.warns():
pass
...
- To ensure that **no** warnings are emitted, use:

.. code-block:: python
with warnings.catch_warnings():
warnings.simplefilter("error")
...
- To suppress warnings, use:

.. code-block:: python
with warnings.catch_warnings():
warnings.simplefilter("ignore")
...
.. _custom_failure_messages:
Expand Down

0 comments on commit 843f03e

Please sign in to comment.