Silence Pytest DeprecationWarning

Pytest ≥ 3.8 by default: show DeprecationWarning and PendingDeprecationWarning.

This warning clutter can be filtered by adding to pytest.ini in the project repo:

[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 or Xarray).

Tags:

Categories:

Written by Michael Hirsch, Ph.D. //

Comments