4
4
import functools
5
5
import warnings
6
6
7
- import matplotlib
8
- from matplotlib import cbook , rcParams , rcdefaults , use
7
+ import matplotlib as mpl
8
+ from matplotlib import cbook
9
9
10
10
11
11
def _is_list_like (obj ):
@@ -15,7 +15,7 @@ def _is_list_like(obj):
15
15
16
16
def is_called_from_pytest ():
17
17
"""Returns whether the call was done from pytest"""
18
- return getattr (matplotlib , '_called_from_pytest' , False )
18
+ return getattr (mpl , '_called_from_pytest' , False )
19
19
20
20
21
21
def _copy_metadata (src_func , tgt_func ):
@@ -26,13 +26,13 @@ def _copy_metadata(src_func, tgt_func):
26
26
27
27
28
28
def set_font_settings_for_testing ():
29
- rcParams ['font.family' ] = 'DejaVu Sans'
30
- rcParams ['text.hinting' ] = False
31
- rcParams ['text.hinting_factor' ] = 8
29
+ mpl . rcParams ['font.family' ] = 'DejaVu Sans'
30
+ mpl . rcParams ['text.hinting' ] = False
31
+ mpl . rcParams ['text.hinting_factor' ] = 8
32
32
33
33
34
34
def set_reproducibility_for_testing ():
35
- rcParams ['svg.hashsalt' ] = 'matplotlib'
35
+ mpl . rcParams ['svg.hashsalt' ] = 'matplotlib'
36
36
37
37
38
38
def setup ():
@@ -51,12 +51,12 @@ def setup():
51
51
"Could not set locale to English/United States. "
52
52
"Some date-related tests may fail" )
53
53
54
- use ('Agg' , warn = False ) # use Agg backend for these tests
54
+ mpl . use ('Agg' , warn = False ) # use Agg backend for these tests
55
55
56
56
# These settings *must* be hardcoded for running the comparison
57
57
# tests and are not necessarily the default values as specified in
58
58
# rcsetup.py
59
- rcdefaults () # Start with all defaults
59
+ mpl . rcdefaults () # Start with all defaults
60
60
61
61
set_font_settings_for_testing ()
62
62
set_reproducibility_for_testing ()
0 commit comments