From 6c7603c9c6bdc466987db9a25b95194f0221f621 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 27 Jan 2023 07:48:50 -0300 Subject: [PATCH] Update doc/en/how-to/capture-warnings.rst --- doc/en/how-to/capture-warnings.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 2e71247a2..4fa48efa0 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -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)