File tree 2 files changed +11
-7
lines changed
Filter options
2 files changed +11
-7
lines changed
Original file line number Diff line number Diff line change 22
22
from matplotlib import ticker
23
23
from matplotlib import pyplot as plt
24
24
from matplotlib import ft2font
25
+ from matplotlib import rcParams
25
26
from matplotlib .testing .noseclasses import KnownFailureTest , \
26
27
KnownFailureDidNotFailTest , ImageComparisonFailure
27
28
from matplotlib .testing .compare import comparable_formats , compare_images , \
@@ -138,6 +139,7 @@ def check_freetype_version(ver):
138
139
class ImageComparisonTest (CleanupTest ):
139
140
@classmethod
140
141
def setup_class (cls ):
142
+ CleanupTest .setup_class ()
141
143
cls ._initial_settings = mpl .rcParams .copy ()
142
144
try :
143
145
matplotlib .style .use (cls ._style )
@@ -146,11 +148,8 @@ def setup_class(cls):
146
148
mpl .rcParams .clear ()
147
149
mpl .rcParams .update (cls ._initial_settings )
148
150
raise
149
- # Because the setup of a CleanupTest might involve
150
- # modifying a few rcparams, this setup should come
151
- # last prior to running the image test.
152
- CleanupTest .setup_class ()
153
151
cls .original_settings = cls ._initial_settings
152
+ matplotlib .tests .set_font_settings_for_testing ()
154
153
cls ._func ()
155
154
156
155
@classmethod
Original file line number Diff line number Diff line change 22
22
'test data.' )
23
23
24
24
25
+ def set_font_settings_for_testing ():
26
+ rcParams ['font.family' ] = 'DejaVu Sans'
27
+ rcParams ['text.hinting' ] = False
28
+ rcParams ['text.hinting_factor' ] = 8
29
+
30
+
25
31
def setup ():
26
32
# The baseline images are created in this locale, so we should use
27
33
# it during all of the tests.
@@ -45,9 +51,8 @@ def setup():
45
51
# tests and are not necessarily the default values as specified in
46
52
# rcsetup.py
47
53
rcdefaults () # Start with all defaults
48
- rcParams ['font.family' ] = 'DejaVu Sans'
49
- rcParams ['text.hinting' ] = False
50
- rcParams ['text.hinting_factor' ] = 8
54
+
55
+ set_font_settings_for_testing ()
51
56
52
57
53
58
def assert_str_equal (reference_str , test_str ,
You can’t perform that action at this time.
0 commit comments