DOCS-#10687: Add a note about -W vs filterwarnings.

Signed-off-by: mvashishtha <mahesh@ponder.io>
This commit is contained in:
mvashishtha 2023-02-07 09:49:17 -06:00
parent 4a46ee8bc9
commit e38517eeb8
No known key found for this signature in database
GPG Key ID: 8B2CD781EA6E77B8
2 changed files with 13 additions and 0 deletions

View File

@ -215,6 +215,7 @@ Loic Esteve
Lukas Bednar
Luke Murphy
Maciek Fijalkowski
Mahesh Vashishtha
Maho
Maik Figura
Mandeep Bhutani

View File

@ -109,6 +109,18 @@ When a warning matches more than one option in the list, the action for the last
is performed.
.. note::
The ``-W`` flag and the ``filterwarnings`` ini option use warning filters that are
similar in structure, but each configuration option interprets its filter
differently. For example, *message* in ``filterwarnings`` is a string containing a
regular expression that the start of the warning message must match,
case-insensitively, while *message* in ``-W`` is a literal string that the start of
the warning message must contain (case-insensitively), ignoring any whitespace at
the start or end of message. Consult the `warning filter`_ documentation for more
details.
.. _`filterwarnings`:
``@pytest.mark.filterwarnings``