@@ -78,21 +78,21 @@ def mpl_test_settings(request):
78
78
style , = style_marker .args
79
79
80
80
matplotlib .testing .setup ()
81
- if backend is not None :
82
- # This import must come after setup() so it doesn't load the
83
- # default backend prematurely.
84
- import matplotlib .pyplot as plt
85
- try :
86
- plt .switch_backend (backend )
87
- except ImportError as exc :
88
- # Should only occur for the cairo backend tests, if neither
89
- # pycairo nor cairocffi are installed.
90
- if 'cairo' in backend .lower () or skip_on_importerror :
91
- pytest .skip ("Failed to switch to backend {} ({})."
92
- .format (backend , exc ))
93
- else :
94
- raise
95
81
with cbook ._suppress_matplotlib_deprecation_warning ():
82
+ if backend is not None :
83
+ # This import must come after setup() so it doesn't load the
84
+ # default backend prematurely.
85
+ import matplotlib .pyplot as plt
86
+ try :
87
+ plt .switch_backend (backend )
88
+ except ImportError as exc :
89
+ # Should only occur for the cairo backend tests, if neither
90
+ # pycairo nor cairocffi are installed.
91
+ if 'cairo' in backend .lower () or skip_on_importerror :
92
+ pytest .skip ("Failed to switch to backend {} ({})."
93
+ .format (backend , exc ))
94
+ else :
95
+ raise
96
96
matplotlib .style .use (style )
97
97
try :
98
98
yield
0 commit comments