File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import matplotlib as mpl
5
5
from matplotlib import cbook
6
+ from matplotlib .cbook import MatplotlibDeprecationWarning
6
7
7
8
8
9
def is_called_from_pytest ():
@@ -38,10 +39,11 @@ def setup():
38
39
39
40
mpl .use ('Agg' , warn = False ) # use Agg backend for these tests
40
41
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
45
47
46
48
set_font_settings_for_testing ()
47
49
set_reproducibility_for_testing ()
Original file line number Diff line number Diff line change
1
+ import warnings
2
+
1
3
import pytest
2
4
3
5
import matplotlib
4
6
from matplotlib import cbook
7
+ from matplotlib .cbook import MatplotlibDeprecationWarning
5
8
6
9
7
10
def pytest_configure (config ):
@@ -41,7 +44,9 @@ def mpl_test_settings(request):
41
44
# default backend prematurely.
42
45
import matplotlib .pyplot as plt
43
46
plt .switch_backend (backend )
44
- matplotlib .style .use (style )
47
+ with warnings .catch_warnings ():
48
+ warnings .simplefilter ("ignore" , MatplotlibDeprecationWarning )
49
+ matplotlib .style .use (style )
45
50
try :
46
51
yield
47
52
finally :
You can’t perform that action at this time.
0 commit comments