File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import matplotlib as mpl
55from matplotlib import cbook
6+ from matplotlib .cbook import MatplotlibDeprecationWarning
67
78
89def is_called_from_pytest ():
@@ -38,10 +39,11 @@ def setup():
3839
3940 mpl .use ('Agg' , warn = False ) # use Agg backend for these tests
4041
41- # These settings *must* be hardcoded for running the comparison
42- # tests and are not necessarily the default values as specified in
43- # rcsetup.py
44- mpl .rcdefaults () # Start with all defaults
42+ # These settings *must* be hardcoded for running the comparison tests and
43+ # are not necessarily the default values as specified in rcsetup.py
44+ with warnings .catch_warnings ():
45+ warnings .simplefilter ("ignore" , MatplotlibDeprecationWarning )
46+ mpl .rcdefaults () # Start with all defaults
4547
4648 set_font_settings_for_testing ()
4749 set_reproducibility_for_testing ()
Original file line number Diff line number Diff line change 1+ import warnings
2+
13import pytest
24
35import matplotlib
46from matplotlib import cbook
7+ from matplotlib .cbook import MatplotlibDeprecationWarning
58
69
710def pytest_configure (config ):
@@ -41,7 +44,9 @@ def mpl_test_settings(request):
4144 # default backend prematurely.
4245 import matplotlib .pyplot as plt
4346 plt .switch_backend (backend )
44- matplotlib .style .use (style )
47+ with warnings .catch_warnings ():
48+ warnings .simplefilter ("ignore" , MatplotlibDeprecationWarning )
49+ matplotlib .style .use (style )
4550 try :
4651 yield
4752 finally :
You can’t perform that action at this time.
0 commit comments