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

This commit is contained in:
Bruno Oliveira 2023-01-27 07:48:50 -03:00 committed by GitHub
parent d73b49d75d
commit 6c7603c9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -276,6 +276,9 @@ first be escaped with ``re.escape``.
Some examples:
.. code-block: python
>>> with warns(UserWarning, match='must be 0 or None'):
... warnings.warn("value must be 0 or None", UserWarning)