Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ filterwarnings =
error
# Remove after support for Python 3.7 is dropped
ignore:After January 1, 2024, new releases of this library will drop support for Python 3.7:DeprecationWarning
ignore:.*Please upgrade to the latest Python version.*:FutureWarning
ignore:(?s).*using a Python version.*past its end of life.*:FutureWarning
Comment on lines +7 to +8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These regular expressions can be made more specific to improve clarity and prevent unintentionally matching other warnings. The filterwarnings option matches patterns from the start of the warning message.

  1. The pattern .*Please upgrade to the latest Python version.* is too broad and will match both warnings you are trying to filter, making the second filter redundant.
  2. The pattern (?s).*using a Python version.*past its end of life.* is also broad, and the (?s) flag is unnecessary for single-line warnings.

Using more specific patterns anchored to the beginning of each warning message is a more robust approach.

    ignore:Please upgrade to the latest Python version:FutureWarning
    ignore:You are using a Python version that is past its end of life.*:FutureWarning

Loading