enable_deprecations_as_exceptions¶
-
astropy.tests.helper.
enable_deprecations_as_exceptions
(include_astropy_deprecations=True, modules_to_ignore_on_import=[], warnings_to_ignore_entire_module=[], warnings_to_ignore_by_pyver={})[source]¶ Turn on the feature that turns deprecations into exceptions.
- Parameters
- include_astropy_deprecationsbool
If set to
True
,AstropyDeprecationWarning
andAstropyPendingDeprecationWarning
are also turned into exceptions.- modules_to_ignore_on_importlist of str
List of additional modules that generate deprecation warnings on import, which are to be ignored. By default, these are already included:
compiler
,scipy
,pygments
,ipykernel
, andsetuptools
.- warnings_to_ignore_entire_modulelist of str
List of modules with deprecation warnings to ignore completely, not just during import. If
include_astropy_deprecations=True
is given,AstropyDeprecationWarning
andAstropyPendingDeprecationWarning
are also ignored for the modules.- warnings_to_ignore_by_pyverdict
Dictionary mapping tuple of
(major, minor)
Python version to a list of(warning_message, warning_class)
to ignore. Python version-agnostic warnings should be mapped toNone
key. This is in addition of those already ignored by default (see_warnings_to_ignore_by_pyver
values).