Silence Pytest DeprecationWarning

less than 1 minute read

Pytest 3.8 brought a new default: DeprecationWarning and PendingDeprecationWarning are shown. These can be disabled by adding to setup.cfg in the project repo:

[tool:pytest]
filterwarnings =
  ignore::DeprecationWarning

We might choose to suppress DeprecationWarning in a repo’s test suite because the warnings are coming from modules developed by others (e.g. Numpy).

Leave a comment