ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

Suppress third party warnings in pytest #857

Open stefsmeets opened 3 years ago

stefsmeets commented 3 years ago

Is your feature request related to a problem? Please describe. Currently running pytest generates a large number of warnings from third-party modules, i.e.

tests/functional/test_multimodel.py: 300 warnings
  /home/stef/miniconda3/envs/esmvaltool/lib/python3.8/site-packages/iris/fileformats/cf.py:221: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
    return tuple((attr, self.getncattr(attr)) for attr in

These are unhelpful, and frankly not our responsibility, but they distract from testing and obscure the warnings that we can fix. I would like to add some filters to remove those warnings as described here: https://stackoverflow.com/questions/58399870/pytest-suppress-deprecationwarning-from-specific-3rd-party-modules

Would you be able to help out? 👍👍

schlunma commented 2 years ago

Moving this to v2.6 since there is not open PR yet.