Silence Pytest DeprecationWarning

Pytest by default: shows DeprecationWarning and PendingDeprecationWarning.

Warning clutter can be filtered by adding to “pyproject.toml” in the top-level project directory:

[tool.pytest.ini_options]
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 or Xarray).

However, don’t be too carte blanche about suppressing DeprecationWarning.


Related: find source of PyTest warning