1010"""
1111
1212import sys
13- import warnings
1413
1514import pytest
1615
1716import iris
18- from iris ._deprecation import IrisDeprecation
1917
2018from .gallerytest_util import gallery_path
2119
@@ -41,21 +39,16 @@ def add_gallery_to_path():
4139
4240
4341@pytest .fixture
44- def fail_any_deprecation_warnings ():
42+ def iris_future_defaults ():
4543 """
46- Create a fixture in which any deprecation warning will cause an error.
47-
48- The context also resets all the iris.FUTURE settings to the defaults, as
49- otherwise changes made in one test can affect subsequent ones.
44+ Create a fixture which resets all the iris.FUTURE settings to the defaults,
45+ as otherwise changes made in one test can affect subsequent ones.
5046
5147 """
52- with warnings .catch_warnings ():
53- # Detect and error all and any Iris deprecation warnings.
54- warnings .simplefilter ("error" , IrisDeprecation )
55- # Run with all default settings in iris.FUTURE.
56- default_future_kwargs = iris .Future ().__dict__ .copy ()
57- for dead_option in iris .Future .deprecated_options :
58- # Avoid a warning when setting these !
59- del default_future_kwargs [dead_option ]
60- with iris .FUTURE .context (** default_future_kwargs ):
61- yield
48+ # Run with all default settings in iris.FUTURE.
49+ default_future_kwargs = iris .Future ().__dict__ .copy ()
50+ for dead_option in iris .Future .deprecated_options :
51+ # Avoid a warning when setting these !
52+ del default_future_kwargs [dead_option ]
53+ with iris .FUTURE .context (** default_future_kwargs ):
54+ yield
0 commit comments